10-10-2016 04:20 PM
Hello everyone,
my name is Carl and I have a problem communicating with a Mass Flow Controller. Before developing a more advanced program I wanted to check the communication and how this works ( I'm new to LabView, only had Matlab and Scala so far ).
As my simple VI is not working I checked if a very simple RS232 communication tool would work (Termite 3.2). It does with the following settings: (IMG_1868)
Very important was the Append CR setting. Then I tried to adapt the settings to my VI. But somehow I think I got the Append CR setting wrong. It is a termination char setting and 13 is the decimal corresponding to carriage return according to different tables I've found in the internet.
My VI is sending a text command and reading the answer every second. The LED shows if there is something read.
As the communication is working with the termite tool it has to be a problem with my VI and the VISA settings.
Thank you very much for you help!
Carl
Solved! Go to Solution.
10-10-2016 04:32 PM
In the "Visa Configure Serial Port" detailed help, it mentions that the 'termination char' for message strings that terminate with a carriage return should have the 'termination char' set to "0xD". Change your code from 13 to 0xD and see if that works.
10-10-2016 04:35 PM
Thanks for the fast answer, I tried this already, but the input for termination char only takes decimals between 0 and 255 as an input. Thats why i tried the 13 as an input for carriage return.
10-10-2016 04:47 PM
Have you attempted to communicate with the device in NI MAX using the VISA Test Panels? Also, I'm assuming that you already installed NI-VISA drivers?
10-11-2016 03:20 AM - edited 10-11-2016 03:21 AM
Hi
Your vi is OK except for the wait 1 second. This should be done after the write and before the read.
Now it is happening in parallel to the write and the read.
You also don't need the wait at all when you have an endcharacter defined and enabled.
You should wire say 255 characters to read and the read will stop at the endcharacter or 255 characters whatever comes first.
LabVIEW is a real parallel language. All that is not connected by wires will execute in parallel.
So to make your program work you could also connect the error out from the write to he error in of the wait and the error out of the wait to the error in of the read bytes at port.
But better don't use bytes at port at all.
By the way 13 decimal and 0xD is exactly the same except for writing......
10-11-2016 06:28 AM - edited 10-11-2016 06:29 AM
@Carlcarl wrote:Very important was the Append CR setting.
You need to use a property node (ASRL End Writes) to have the CR automatically appended on the writes.
10-11-2016 12:40 PM
I installed the VISA drivers yesterday and tested the ASRL wire and now it worked! Thanks a lot guys!