11-18-2010 03:30 PM
Dear All,
I am just starting to use LabVIEW and developing a instumental driver.
The program is rather sequentially designed because I am only used to work with text-based program.
The current program is working in debugging mode without any error message.
To give an idea of how it is composed:
1. Set up the serial port setting (machine address, baud rate, parity, etc)
2. Send to the instument the name of a short program to be run.
3. Send mutiple string commands to the instruments. Those string commands construct a short program to control the instrument.
4. Send another string command to run the short program
The issue is that it does not work in excution mode. It looks to me that the communication between the instrument and computer seems to be too fast.
Since the program is designed in a sequential manner, it does not have any while-loop or for-loop so I cannot add any timing function.
Could anyone give me a hint or a right direction to fix this issue? It would be really appreciated. Thank you.
Solved! Go to Solution.
11-18-2010
03:43 PM
- last edited on
10-10-2024
03:15 PM
by
Content Cleaner
You likely need delays between commands. You can use the Time Delay Express VI to insert time delays in your code by using the error clusters. You can wire these to the error in/out terminals of the VISA functions.
Another option is to use a for-loop to send your multiple commands rather than stringing several VISA Write functions in a chain. You use the Time Delay VI within the loop to wait between commands.
You may wish to upload your code to see if any other suggestions can be mode to improve the code.
11-18-2010 03:48 PM
Hello,
Thank you very much for your reply.
While I am following your suggestion, I am uploading the current VI which has the issue. Since it is a driver, it won't work without the instrument (I guess) but it will definite help to understand my problem. Again thank you very much.
Best,
11-18-2010 03:55 PM - edited 11-18-2010 03:56 PM
I am also upload one typical subVI for the each string command. Thank you.
11-18-2010 04:15 PM
Hello,
Out of two suggestion, I have tried the first one: putting "time delay function," and it seems to work. Thank you very much. However, as you mentioned in your email, I had to put 15 time delay functions between the string commands (yes.. it was doable).
So, I also would like to take the second suggestion of yours, but I am not quite sure how I have to implement into the for loop. Since the each command has different strings, how can I put those commands into the for-loop? I guess that my question might be too trivial to most of you, but I am spending several hours to work it out. Could you kindly elaborate your suggestion? Thank you very much.
Best
11-18-2010 05:12 PM
You could do something like the attached modification.Note how I modified the connector pane for the subVI to use the conventional 4-2-2-4 pattern and notice where I connected the terminals.
NOTE: I am assuming the VI is supposed to run just once, and that you're not using the Run Continuously button in the toolbar. You're not, right?
11-18-2010 07:55 PM
Hello,
Thank you very much for your valuable help!! I was able to use the example that you provide me with, and it works! Again, I really appreciate you prompt replies.
Have a great day!
Best,