06-06-2019 08:29 AM
Hi,
I am trying to design a LabVIEW to get the temperature through the PMD-MXT temperature sanner. It is possible to get the response through the serial port utility. But I cannot get any response with the LabVIEW serial read and write example. I design my own one and it still doesn't work.
Could you help me?
Solved! Go to Solution.
06-06-2019 09:41 AM
May you save your vi for LabVIEW 2017 or earlier version? I can't read it.
06-06-2019 09:57 AM
This is the 16.0 version file. Also here is a screenshot for the serial port test.
06-06-2019 10:32 AM
Your vi does not show what's the string you are sending. Do you properly terminate the command with a line feed or a carriage return?
I suggest to concatenate a LF constant (String palette) to the command you are typing manually into write buffer. Use a big delay between read and write as a first test.
However, using a delay and Bytes at port is not the best option. I guess the response is also terminated with LF or CR, although the manual does not say anything about it. If the terminator is LF, remove Bytes at port and wire to byte count a constant bigger than the length of the message you expect as a response. Also, wire a reasonable timeout to VISA Configure Serial Port, say one second. The Read function will return as soon as the terminator character is received. If the terminator is CR, you should also wire 13 (decimal) to the termination char input of VISA Configure Serial Port.
06-06-2019 10:51 AM
I just find it said in the manual that the command is terminated with CR or LF. I will try both ways to read it.
06-06-2019 11:22 AM
I changed the wiring but it said
Error -1073807194 occurred at Property Node (arg 😎 in VISA Configure Serial Port (Instr).vi->read rs485.vi
Possible reason(s):
VISA: (Hex 0xBFFF00A6) The connection for the given session has been lost.
Are there some other problems do I have?
Here is the new vi and command I sent.
06-07-2019 01:48 AM
I guess you put the string control write buffer in '\' Codes display? Otherwise \n will be sent as two characters.
06-10-2019 08:19 AM
I put \n as the command termination and I replace it with \. It still doesn't work.
06-10-2019 10:01 AM
Try with this vi.Try also wiring 13 as Termination Character. If it works, how much time is needed to get a response?
Remark that two string controls or indicators feature the '\' Codes Display option.
06-11-2019 01:25 PM
I try both 10 and 13 as termination character, and it is not working.