LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa read backlog

I am trying to run VISA commands to a motor. There is a command for the motor that allows it to return a value once it has reached the position it was sent to, but the labview interface I created will not automatically return the value. The subvi must be run twice to return the value, which causes the motor to have to go double the rotation than the user defined rotation. When the value to return is changed, the program continues to return the previous value for some time after, making me feel like the information is backlogged in the system. Is there a way to make the value return from VISA read after the motor has stopped? I have attached the subvi in question.

0 Kudos
Message 1 of 6
(3,196 Views)

What motor are you controlling?  Does the motor use a termination character for its communications?

 

The "wait and then check number of bytes in the port" is a very common race condition.  If your motor uses the termination character, you really should just tell the VISA Read to read more bytes than you would ever expect from a message.  Yes, you have a very good chance that you hit this said race condition and therefore you are just reading "old" data in the buffer.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(3,180 Views)

It's a LinEngineering stepper motor. It doesn't use a termination character for communication. Thus, when the byte number is changed, the problem persists. Do you know if there is anything else I could try?

0 Kudos
Message 3 of 6
(3,175 Views)
Please provide the exact model number and attach the programming manual. If the vendor provides a software utility, you can use a sniffer such as portmon to see how they do it.
Message 4 of 6
(3,141 Views)

The model of motor is CE-5718L-01PD-60RO

0 Kudos
Message 5 of 6
(3,120 Views)
That is the software utility you would need to sniff. It does not explain whether or not there is an actual termination character. All of that would be hidden in the program itself. There is nothing provided that I see at first glance for using third-party software.
0 Kudos
Message 6 of 6
(3,065 Views)