LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Write

Hi!!!
 
I would like to send a program, which is in a text file, into my instrument(SOLARTRON 1250 FRA). However, my instrument only accept one line of my program. So I would like how can I send my program line by line, if someone have an idea because I don't know how to start...
 
Thanks
 
----------------------------
My program:
 
00 EP 03
00 EP 03
00 EP 09
00 EP 04
00 CP
00 EP 04
00 EP 01
00 CP
00 EP 09
00 EP 03
00 CP
00 EP 09
00 CP
00 EP 08
99 *Q

Message Edité par Szdiablo le 05-09-2007 06:15 AM

0 Kudos
Message 1 of 9
(2,326 Views)

Hi,

Sending ur program line by line is not a problem. You can send it by creating an array of constant string, with each array element containing one line of command. Than get the array as input in a for loop to write the commands one by one with some delay. 

But this all depends upon what action are caused by these commands.

Regards

DC

 

0 Kudos
Message 2 of 9
(2,312 Views)

Can you show me how to do that???

Thanks

0 Kudos
Message 3 of 9
(2,295 Views)
 Than get the array as input in a for loop to write the commands one by one with some delay. 
 
I don't understand how to do that...
 
 
 
0 Kudos
Message 4 of 9
(2,287 Views)
This is not all the functionality but this is the idea.  I don't have more time or I would help more.  This should get you going though.
 
Tom
 
 

Message Edited by Tom Haggerty on 05-09-2007 11:23 AM

Message 5 of 9
(2,274 Views)
I try your vi but I don't find an element of it. I circle the element in red. I attach too my vi if you see some errors???
(I have LABVIEW 8.0)
 
Regards

Message Edité par Szdiablo le 05-10-2007 03:10 AM

Message Edité par Szdiablo le 05-10-2007 03:16 AM

Download All
0 Kudos
Message 6 of 9
(2,255 Views)
This is just a constant. Here is how you can create it :

  1. Right click on an empty zone of the diagram >> Array >> Array Constant >> put it on the diagram
  2. Right click on the black constant >> String >> String Constant >> put it inside the Array Constant
  3. Move the mouse to the lower part of the Index Display of the Array Constant >> resize it. An alternative way is to right click on the Index Display >> Add Dimension

Message 7 of 9
(2,247 Views)

Thanks for your help

But I still have a problem. Actually when I added the "for" loop the connections of error and I/O  cut....and I don't know why??

You can see that on my vi( the visa write  " *p ", " *e5 "... are instructions which control my instrument)

 

Regards

Message Edité par Szdiablo le 05-10-2007 04:23 AM

0 Kudos
Message 8 of 9
(2,235 Views)
This is the expected behavior because the indexing of the for loop is enabled. This way the output is an array and a new element (always the same in this case) is added to it on each iteration of the loop.

By default, the indexing is enabled. To disable it for a wire, right click on the corresponding tunnel (square where the wire crosses the loop) on the right border of the loop and select Disable Indexing.

For the error wire, it is recommended to replace the tunnel with a shift register. Right click on the left tunnel of the error wire, select Replace with Shift Register and finaly click on the right tunnel. Now, the error wire will be updated from one iteration to the other.

I strongly recommend you to take some minutes to read the LabVIEW help to get familiar with these basic options !
Message 9 of 9
(2,227 Views)