01-27-2020 05:32 AM
Solved! Go to Solution.
01-27-2020 06:29 AM
You could make DLLs in LabWindows and then call them in LabVIEW. But there is no direct conversion.
01-27-2020 06:37 AM
01-27-2020 08:17 AM
@MajklS wrote:
Sure, this is what I wanted to know, a pity it's not possible when it's practically on the same platform.Can I find some way to create DLLs?
But it's not the same platform. They are two completely different software platforms.
01-27-2020 11:21 AM
@MajklS wrote:
Sure, this is what I wanted to know, a pity it's not possible when it's practically on the same platform.
Same company. Completely different paradigms. LabWindows/CVI is an ANSI C environment while LabVIEW is a data flow programming environment.
01-27-2020 11:15 PM
01-28-2020 05:56 AM - edited 01-28-2020 05:59 AM
@MajklS wrote:
I see. I understand, thank you for the explanation.So I would have another question, I have stored data in fields from
RdData [0] to RdData [9].
Data goes on serial line RS232.
α = ComRdTerm (COMP, RdData, 900.0xff);
For example, I have Height on RdData [1] and I want to display it in the StripChart.
How can I read this data in LabView?
Generally you use NI-VISA functions to communicate with an RS-232 device.
Principally you use VISA Configure Serial Port.vi to initialize the port to the desired communication parameters and then a VISA Write to send a command to the device if necessary and then a VISA Read to read the response from the device.
Your parameters to ComRdTerm() look a little funky though. If your RdData array has only 10 elements declared you definitely shouldn't tell the function to attempt to read up to 900 bytes. Also the decimal point should be likely a comma to separate the termination character code from the rest as a separate parameter.
To get NI-VISA to use 0xFF as termination character like used in your C code example, you would have to connect a constant with that value to the according VISA Configure Serial Port.vi input. Then VISA Read will return as soon as it encounters this termination character in the serial data stream (or an error or the timeout occurs).
VISA Read will return a LabVIEW String but you can easily convert that into a byte array with the String to Byte Array node and then reference the bytes with an Index Array node.
If your returned data is more complex than individual bytes you can use the Unflatten from String function instead to turn the received string into a LabVIEW Cluster, which is the equivalent of a C struct.