LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

How to execute a series command automatically

Solved!
Go to solution

Thanks. But it seems that this will not work for multiple I/O?

0 Kudos
Message 11 of 24
(681 Views)

Your timing may be off because the code is not enforcing the wait to occur after the VISA command. The wait function was floating in space, which means that there is no guarantee that it will occur before, during, or after the call to VISA write. Use the error cluster to enforce data flow:

 

Wait after VISA Write.png

Feel free. Contact me for anything more,
    Pang

You too can be LabVIEW Awesome!
0 Kudos
Message 12 of 24
(674 Views)

I think we'd better look at the manual.  I don't think commands are being sent exactly correctly.  Needing hardcoded waits almost always signals that there is an incomplete understanding of the sending and receiving of data.  Unless the manually specifically states that you need to insert hardcoded waits, there's usually no need for them.

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.
Message 13 of 24
(657 Views)

Here is an actual example of the way I write a series of commands to an instrument.

 

mmulti visa.PNG

 

mmulti visa2.PNG

 

 

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 14 of 24
(617 Views)

I do the same as RTSLVU.  As far was the wait inside of the loop, some instruments do not need the wait, others need 50ms, others 500ms.  So do not be surprised is something does not work because you did not allow the instrument to do its thing before the next message comes in.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 15 of 24
(603 Views)

@crossrulz wrote:

I do the same as RTSLVU.  As far was the wait inside of the loop, some instruments do not need the wait, others need 50ms, others 500ms.  So do not be surprised is something does not work because you did not allow the instrument to do its thing before the next message comes in.


Yeah, I had to add that 200mS because on the older Ci5000 units we have can't take it in any faster. I would get a "comand buffer overflow" error or something like that.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 16 of 24
(594 Views)

@RTSLVU wrote:

Yeah, I had to add that 200mS because on the older Ci5000 units we have can't take it in any faster. I would get a "comand buffer overflow" error or something like that.


At least you got an error.  I had an oscilloscope that would appear to not even process the command unless I had a 500ms wait between commands.  Granted, I think it did actually do the command, but other things it was processing due to previous commands over-wrote the settings I gave it.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 17 of 24
(585 Views)

Thank you for everyone's help. I have evetually used QMC and state machine to address my question.

 

I did have to add 30000ms wait time for some command, it is just how my instrument work ...

Best to everyone!

0 Kudos
Message 18 of 24
(562 Views)

Half minute wait time? Smiley Surprised

0 Kudos
Message 19 of 24
(548 Views)

It would be a good time to upload the manual.

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 20 of 24
(535 Views)