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.
May you save your vi for LabVIEW 2017 or earlier version? I can't read it.
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.
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.
I changed the wiring but it said
Error -1073807194 occurred at Property Node (arg 8) in VISA Configure Serial Port (Instr).vi->read rs485.vi
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.
I guess you put the string control write buffer in '\' Codes display? Otherwise \n will be sent as two characters.
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.