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.
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.
06-22-2006 04:18 PM
06-23-2006 12:16 PM
06-23-2006 02:07 PM
06-23-2006 02:31 PM - edited 06-23-2006 02:31 PM
Message Edited by nostra on 06-23-2006 02:35 PM
06-23-2006 02:34 PM
06-23-2006 03:08 PM
Nostra-
In looking at the serial VI that case structure is false when you are not getting a positive value from the bytes at port...you said it was ALWAYS false giving -99999. Are you just never getting data? I don't know if continuously reading would help if you are not getting any data at the port. You should check to make sure you know what data is supposed to be acquired.
Right now your program will go through the outer while loop and enter the serial Vi and write to the port (which i am assuming will trigger the device to generate data) then it waits the timeout and tries to read. If no data then it returns the -99999 Then repeats the whole process....so if you missed that data then it will loop around again and write and then miss it again. Try making your timout bigger to make sure you catch the data or change your program so that it reads longer before it closes the resource. Basically right now it is reading that one time and if the data is not there then it starts over again. You could put a for loop around the read, or around the bytes at port so that it has more than one opportunity to get the data.
Hope that helps.
John Harvey
Applications Engineer
National Instruments
06-23-2006 04:11 PM
06-23-2006 05:32 PM
Nostra--
I spent a little time playing with your VI with an instrument we have here. The only time I was getting the constant 99999's was when the timeout in the serial VI was too slow. Which is what I was trying to get at....so I just wanted to be sure the wait in the main VI is not the same as the timeout in the serial VI. I am sure you are already aware but I wanted to be sure. So, just let me know and we'll see if we need to look at something else.
Regards,
John H.
Applications Engineer
National Instruments
06-23-2006 11:48 PM - edited 06-23-2006 11:48 PM
Message Edited by nostra on 06-23-2006 11:50 PM
06-26-2006 09:31 AM
Nostra--
There are two possible places to change the time in the VI that Dennis put up. In the top level VI there is a wait in the while loop. This makes the program wait this amount of time between every acquisition. The second place is the wait IN the serial VI (if you double click on that one) and is located right before the bytes at port. This controls the amount of time to wait between issueing the command (write) and getting the data (read) If this is too small then the instrument hasn't completed and there is nothing to read and you will get the 99999's.
With the instrument I have here, the only time that I was getting 99999's was when the wait between the write and read wasn't long enough to let the instrument finish. Try making that wait longer and let me know.
John