LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write this in LV

Hello All
How to write the following C code:

void write(int addr, int data)
{
struct
{
char cmd;
int addr, data;
} msg;

msg.cmd = 'W';
msg.addr = addr;
msg.data = data;
send(&msg, sizeof(msg));
}


in LabView.
0 Kudos
Message 1 of 3
(2,391 Views)
Answers can be found here : (Duplicate thread)

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HFORCEKWTID=42894:5&HOID=5065000000080000009F5F0000&HExpertOnly=&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 3
(2,391 Views)
Take a look at the LabVIEW "cluster" object. This is very similar to a C structure. You can built a cluster with any combination of control types and pass it in and out of other VIs. This would be the best way to implement such an object in LabVIEW.
J.R. Allen
0 Kudos
Message 3 of 3
(2,391 Views)