03-02-2007 11:15 AM
Error -1073807202 occurred at Property Node in VISA Configure Serial Port (Instr).vi->Serial_test_code_LDT.viThe error occurs already where I try to configure the serial port with the following example. I also replaced the VISA resource with a constant and typed COM2 into it which is the port I want to access. I have the doubt that something went wrong when I installed 8.20 and maybe some important part of the RT-Library is missing. From earlier posts to this forum I found that there should be a vi-palette related ot serial ports under fieldpoint which I do not find on my system. If I am correct that soemthing went wrong during installation how can I track this down and probably reinstall the component in question?
Possible reason(s):
VISA: (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded.
03-04-2007 02:06 PM
Olaf,
Two parts of the upgrade. Development software and cFP software.
Make sure that you upgraded all the software on the cFP to match the exact versions on your development machine. Pay particular attention to NI-VISA and NI-Serial RT
05-04-2007 04:48 AM
Sorry, I totally forgot to answer lately. Since I ran in to this "two-part" upgrade thing before this time I upgraded the Fieldpoint software immediately but still got this problem. MAX showed that all drivers were up to date! But after your response I re-installed everything anyhow and first deleted all old versions on the Windows PC and that did the trick.
@centerbolt wrote:
Olaf,
Two parts of the upgrade. Development software and cFP software.
Make sure that you upgraded all the software on the cFP to match the exact versions on your development machine. Pay particular attention to NI-VISA and NI-Serial RT
05-04-2007 07:29 AM
Olaf,
It does sound like you are encountering a buffer overflow. Handshaking can play a part in this. I think I would start by verifying whether or not you are encountering a buffer overflow. Does the 128 bytes that you do receive look like correct data? Is your vi generating any errors?
From the image you posted, it looks like you are using some sort of handshake during the read. Is that correct? Can you post your vi's that configure the port and read the port?
05-04-2007 09:18 AM
By looking at the data I can see that the first 4-5 read cycles look reasonable, because the 20 byte status is sent first and looks different from the binaray data that follows. Then there are a couple - maybe 5-10 - more read cycles where data looks strange until nothing happens anymore - meaning no data seems to be received anymore. Regarding the handshaking: I have to look into this a bit more since the original code is not from me and the programmer has left our group a year ago. I will add the relevant paragraph concerning handshaking from the manual at the end of this message. It looks like our code does not do exactly what the manual says but I remember that our programmer had a hard time gettting this running at all after a lot of trial-and-error.....
@centerbolt wrote:
Olaf,
It does sound like you are encountering a buffer overflow. Handshaking can play a part in this. I think I would start by verifying whether or not you are encountering a buffer overflow. Does the 128 bytes that you do receive look like correct data? Is your vi generating any errors?
From the image you posted, it looks like you are using some sort of handshake during the read. Is that correct? Can you post your vi's that configure the port and read the port?
05-04-2007 12:07 PM
Olaf,
Suggest you start by setting serial buffer size to something like 1K.
05-07-2007 05:13 AM
So I set the buffer size to 1024 as you suggested. Unfortunately this did not change the behaviour at all. One thing I realized when playing around with different modifications to my code: The VISA-serial-read-vi can be set to synchronous and asnchronous I/O. It was previoulsy set to sync. although in the LV-manual it says that for serial ports I/O is async. I dont relly know what that setting means and I tried to change it without a lot of effect. Maybe this should have been async. from the beginning and code optimization has been falsely done with a wrong setting here (being probably very unstable to changes in overall code performance and timing)?????
@centerbolt wrote:
Olaf,
Suggest you start by setting serial buffer size to something like 1K.
05-07-2007 08:00 AM
I already found out that the VISA sync/async settings are different from what it means to serial comm. Some testing gave additional information. Previously the timeout was set to 500 (I guess 500 ms) and I now set it to 10000. The result is that with VISA I/O set to sync the data now looks always correct while there is still only 128 bytes read instead of the expected 532. Since my vi's measure the time it takes for the read to complete I see that with sync it takes the full 10 sec until timeout to read the data. Interestingly, when I set VISA I/O to async. the data looks "corrupted" after a few read cycles. The first few "correct" cycles read in about 1 second while the "corrupted" data scatter heavily but take roughly between 5 and 30! seconds. Still, always 128 bytes read (buffer set to 1024) instead of 532 expected.So I set the buffer size to 1024 as you suggested. Unfortunately this did not change the behaviour at all. One thing I realized when playing around with different modifications to my code: The VISA-serial-read-vi can be set to synchronous and asnchronous I/O. It was previoulsy set to sync. although in the LV-manual it says that for serial ports I/O is async. I dont relly know what that setting means and I tried to change it without a lot of effect. Maybe this should have been async. from the beginning and code optimization has been falsely done with a wrong setting here (being probably very unstable to changes in overall code performance and timing)?????
Olaf
05-07-2007 08:05 AM
Olaf,
I suspect the problem is in the read sequence. I read the spec for your instrument and I must admit this is a very unusual serial interface. It looks like your program alternates the DTR line based on the timing of timed loop and not in response to a byte being received. I can not tell from what you posted how fast the loop is running? If it is running too fast, it may confuse the instrument. Can you post a bit more of the read sequence?
I would suggest that you modify the read so that you only toggle DTR after a byte that is not the termination character has been received. The VISA bytes at serial port will allow you to monitor how many bytes have been received.
05-09-2007 02:25 AM
I have now written my own read-function which exactly does what the specs say and what you repeated in your reply. In the best case I get 128 bytes, if I play around with timing I get sometimes a more unstable result and less bytes but never more than 128. What puzzles me is that the maximum I get in all cases I tried is a highly "suspicious" number. I really get the feeling that something with the drivers might be broken. I will try to install the most recent version of LV today and see what happens. If nothing changes, I will try the old version of "our" software which worked perfectly under LV 7.X, with LV 8.20. (For the current LV 8.20-software I did some major modifications to the code but I did not touch the code that communicates via serial. So, the overall timing might have changed, but the serial comm code is as it was when it worked under LV 7.0.
@centerbolt wrote:
Olaf,
I suspect the problem is in the read sequence. I read the spec for your instrument and I must admit this is a very unusual serial interface. It looks like your program alternates the DTR line based on the timing of timed loop and not in response to a byte being received. I can not tell from what you posted how fast the loop is running? If it is running too fast, it may confuse the instrument. Can you post a bit more of the read sequence?
I would suggest that you modify the read so that you only toggle DTR after a byte that is not the termination character has been received. The VISA bytes at serial port will allow you to monitor how many bytes have been received.