07-16-2018 07:47 AM
Dear LabVIEW Champions,
I have a device with Serial communication. I have written a program to read and write (give command) to the device using VISA. I have to continously read and write according to some other Parameters.I have attached 3 VI's for reference. The Problem is described below.
1. When I write (give specific temperature ) to device, it successfully accepts it and Change the temperature. But when I read it gives me the value which I recently write (give command). It does not Show me current temperature of device.
2. After one or two times, it Shows me 0, when I try to read the temperature.
3. If I do not write, it gives me correct read values. But when I write and then read... it gives me wrong values.
Hopefully I could explain the Problem.
I am looking Forward for meaningful reply.
Thank you so much in advance.
Khan.
07-16-2018 08:18 AM
First of all, don't use bytes at port. Your device seems to be using a termination character, at least your initialize subVI sets up the connection to use one, so take advantage of it. When you do a VISA Read, wire in a number of bytes larger than the longest message you expect to get.
Can you attach the VI where you put all of these subVI's together into a bigger program. It is hard of us to know how you are actually using them.
Have you read the manual? Most devices have a command response format. So if you send a command, the device responds back. I would expect a command that tells a device to set a temperature to respond back with a message that says what temperature it was set to. I would expect there to be a different command to write to the device if you want a message back that tells you what the current temperature is.
07-16-2018 09:18 AM
What exactly is the device you are trying to communicate with? Is there a manual you can link us to? There are likely details in the communication protocol that you are not quite understanding which can cause all kinds of issues.