LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to pass a constant to a cin expecting a pointer to a value?

I have a cin which has a leg that is expecting a pointer to a value. On the diagram, what is the best way to connect a constant widget to this leg of the cin? Connecting it directly crashes labview as it treats the constant as a pointer to memory.

Thanks
0 Kudos
Message 1 of 3
(2,751 Views)
I am not sure that I understand your issue. CIN variables can be Input-Output or Output only. Either way, they are being passed in as a pointer to a value. You can see this very easily by placing down a CIN and wiring a constant integer to it. Next, right-click on the CIN and create the C file. You will see that the parameter list has an int* in it.

If you are still having problems, do you have to create a CIN or can you create a DLL instead? The DLL will give you a few more ways to pass the data than a CIN does with no real performance decrease.

Also, have you read the "Using External Code in LabVIEW" manual? This hsould answer some questions as well.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,751 Views)
Hi,

sorry, newbie confusion, I was getting segmentation faults from 0 address accesses and initially blamed it on passing constants to CINS. It seems to be caused by something else....
0 Kudos
Message 3 of 3
(2,751 Views)