From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-17-2008 11:05 AM
02-17-2008 01:52 PM - edited 02-17-2008 01:57 PM
huangjack wrote:
I am trying to use "Call Library Function Node" to call a DLL to control a device.
The prototype of one function in the DLL is: function putcommand(prec: pointer):longint;
The mannual describes the function as following:
"Together with the Putcommand function ,a 32 bit pointer, which points to command
message structur (see below) is to be transferred to the DLL."
TCommandMsg = packed record
ApId : longint;
commandnr : word;
command : tcommand;
end;
where the "tcommand" structure is shown below:
tcommand = packed record
commandID : word;
param : tparam;
end;
Both the type and size of the fields within the two structures are given.
How can I pass the parameter from LV to the DLL?
Thanks
02-17-2008 06:45 PM
huangjack wrote:
I am trying to use "Call Library Function Node" to call a DLL to control a device.
The prototype of one function in the DLL is: function putcommand(prec: pointer):longint;
The mannual describes the function as following:
"Together with the Putcommand function ,a 32 bit pointer, which points to command
message structur (see below) is to be transferred to the DLL."
TCommandMsg = packed record
ApId : longint;
commandnr : word;
command : tcommand;
end;
where the "tcommand" structure is shown below:
tcommand = packed record
commandID : word;
param : tparam;
end;
Both the type and size of the fields within the two structures are given.
How can I pass the parameter from LV to the DLL?
Thanks
02-17-2008 10:03 PM
The tparam is a case structure.tparam = packed record
case byte of
1 : (B1,B2,B3,B4 : byte);
2 : (w1,w2 : word);
3 : (i1,i2 : smallint);
4 : (r1 : single);
5 : (l1 : longint);
end;