XY图制作波形图显示,并让波形值随波形一起跑。
效果:没法上传视频。
感谢:QQ群: Labview学习交流 群中的大神 “重庆-自动化(178447529) ” 技术支持,不然我还要搞两三天都不一定能搞得定。
程序框图:
前面板:
DLL可以用这公式节点
下面是DLL,拆腾了我好久
.h 文件代码:
#ifdef _position_calc_h
#define _position_calc_h
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
extern "C" _declspec(dllimport) void positioncalc(int Heigth, int Width, int Left, int Bottom, int xsize, double yvalue, double xmax, double xmin, double ymax, double ymin, double* SW, double* SH, double* Dxp, double* Dyp);
#endif // _position_calc_h
Main文件代码:
#include "position_calc.h"
#include "pch.h"
extern _declspec(dllexport) void positioncalc(int Heigth, int Width, int Left, int Bottom, int xsize, double yvalue, double xmax, double xmin, double ymax, double ymin, double* SW, double* SH, double* Dxp, double*Dyp)
{
*SW = double(Width / (xmax - xmin));
*SH = double(Heigth / (ymax - ymin));
*Dxp = double(Left + (xsize * *SW));
*Dyp = double(Bottom - (yvalue * *SH));
}
DLL参数配置:
注意DLL调用时与封装DLL时顺序须一致;