Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding event control during runtime

Hi I am usuing two vi (Config Vi and  Mov vi) to configure a instruments first and to to send a position value command
to it so that the instruments moves to that position.
So when I run the whole (Move nd Pos.vi attatched) it configure and then send a positition command together with the required position and moves to that position and end. The programs works well but, 
 
What I I want to do is
 
1> To have a option so that after I run the whole vi( Move and Pos.vi) continuously it will continuously check whether I changed the position value , and if I change it then only it will start the MOV vi and will send the position value command and again it will come back and wait to see whether I change the position and it will continue like that.
Currently it is doing the configuration everytime and then send the position which reset the instrument everytime.
 
I understood that I need to use the event control with while loop, but didnt able to understood properly.
Can someone pl give me a clue.
 
with best regards
Ray
0 Kudos
Message 1 of 5
(3,593 Views)
Ray-

It sounds to me like the event structure is the way to go. You can look for a value change event on the position control and then initiates a move command. Here's a basic idea of what your program will look like (with a call to your MOVE.vi inside fo the case structure).

Xaq
0 Kudos
Message 2 of 5
(3,561 Views)
 Dear Xaq
 
Thank you very much for your reply.
I did that what you said , but still it doesnot work properly.
 
I post the modified vi already along with all the subvi ( zip file)  in a later post ( in page 1 of thsi forum) as
<How to use value change event properly in position control >
 
I would appreciate if you can check and tell me whats goes wrong.
I also checked  that the individual <MOV.vi> works well in loop mode ( I mean when I run it continuosly)
provided I configured the system prior by that other vi , and I can continously can the position but
when I connect it with configure vi and use a event loop then only first time I can change the position.
 
 
with best regards
Ray11
 
 
0 Kudos
Message 3 of 5
(3,552 Views)

Hi Ray,

Please keep posting in the same thread if you are still dealing with the same problem. It makes it easier for LabVIEW users worldwide to keep track of the same issue.

Here is a link to your other post:
http://forums.ni.com/ni/board/message?board.id=140&message.id=22514

Let's keep all the work in this thread.
Best regards,

Kalin T.
0 Kudos
Message 4 of 5
(3,542 Views)
Ray-

There were a couple issues with your VI. First, you were passing in a single value to your loop instead of reading the new value each time the event was called. You may also want to use a timeout case and monitor the error line. I've made those modifications in the attached VI.

Xaq
0 Kudos
Message 5 of 5
(3,529 Views)