From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Write problem

I have a problem with tunneling the strings comming from a for loop to the VISA Write VI. The for loop generates drive commands ( for example DRV 50,75) with a curtain frequency. Those commands have to send directly with the VISA Write VI. The tunneling is the problem. If I chose the Tunnel Mode "Last Value", only the last command is send. How to solve this problem???

Thanks and regards...

0 Kudos
Message 1 of 12
(6,057 Views)

Maybe the complete VI helps more...

0 Kudos
Message 2 of 12
(6,043 Views)

Please take some LabVIEW tutorials and learn about dataflow.

 

LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

It has nothing to do with tunnel mode.  Your VISA Write will never execute.  You have loops buried in loops.  Your inner while loop has a false wired to the stop constant which means that loop will never end without aborting your VI.  Due to dataflow, your VISA write won't execute until your while loop ends, which it can never do.

0 Kudos
Message 3 of 12
(6,039 Views)

Ignoring all the other rookie mistakes in your code. If you want to send a series of commands to an instrument using VISA Write do it like this.

 

mmulti visa.PNG

Build an array of your commands and index them with a for loop to send them one at a time, remember to wait long enough between commands to allow your instrument to process that command before sending another one.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 12
(6,024 Views)

The intension was something like that, sending one specific command (for the time being) with two parameters to drive two motors (in %): DRV 75,75\n and than waiting for a response for the position: POS 127896,127869\n of the shaft encoders. Now I am programming it step by step, let the target send every second a position response, but have a problem at VISA read. At configuration of the serial port I enable the termination char for \n in the hope that the stream of responses is split up in separate responses. The length of the response (position) is variable, so at VISA read vi I define the byte count > is the number of response characters. Then I split op the individual responses in tokens, convert the strings to integers and plot them. The result works with strange behavior. The incrementing values of the positions fall back to zero after every good sample. What is the reason? See also the two images.
Thanks and regards...

Download All
0 Kudos
Message 5 of 12
(5,986 Views)

The write problem is solved. On the read problem I am working and then the integration of both so they can work autonomous in one vi. Any recommendations?

Thanks and regards....

0 Kudos
Message 6 of 12
(5,970 Views)

What is the point of demeaning someone online? 

0 Kudos
Message 7 of 12
(5,457 Views)

What's the point of dredging up a post that is over a year old to make a comment like that?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 12
(5,451 Views)

Why does the date of the comment matter? It was still rude. 

0 Kudos
Message 9 of 12
(5,449 Views)

@MT6292 wrote:

What is the point of demeaning someone online? 


What is the point of making that point a year later?  😉

 

Actually, I've learned that you must have some thick skin to stay in the game here.  And I have to admit that I have treated some noobs rather roughly.  Usually unintentionally, but that's... usually.  No one is perfect in this regard, but we try to be reasonable.  I assume you are referring to RTSLVU's post.  Unfortunately, I have seen - as well as been - worse than that.  😞

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 12
(5,446 Views)