Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication Problem

Nowhere are you sending the termination charact - \n. What you are sending are the characters '\' and 'n\'. This has been discussed hundreds of times and the basic serial example shows the correct way. You must right click on the constant and select '\' Codes Display if you want to use \n as single control code.

 

p.s. Get rid of the bytes at serial port. With the VISA Configure Serial Port you have enabled the read to stop when a termination character is detected. The VISA Bytes at Serial Port is not used in this setting. You just wire in some high byte count.

Message 11 of 19
(2,003 Views)

I got rid of the bytes at serial port and I know that the commands that I am sending are correct because I have used them all in the basic serial read and write and have had success. That is why this problem is confusing me. I just ran my VI and got the following error:

 

Error -1073807339 occurred at VISA Read in Xitron Integration.vi

Possible reason(s):

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

 

 

0 Kudos
Message 12 of 19
(2,000 Views)

The controls in that example already have the display settings to '\' Codes.  Set your constants to that also (right-click, '\' Codes Display) and you will see that you are actually sending invalid commands.  The device isn't seeing the request for data, and therefore you get none.

 

I went ahead and cleaned up you code with changes made in this discussion (attached).

 

I can't believe I didn't see that earlier.  Good call Dennis.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 19
(1,995 Views)

@jstrike21 wrote:

I got rid of the bytes at serial port and I know that the commands that I am sending are correct because I have used them all in the basic serial read and write and have had success. That is why this problem is confusing me. I just ran my VI and got the following error:

 

Error -1073807339 occurred at VISA Read in Xitron Integration.vi

Possible reason(s):

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

 

 


Your commands in YOUR vi are not correct and if you had simply right clicked as I said, you would have seen your mistake.
0 Kudos
Message 14 of 19
(1,979 Views)

Hi jstrike21,

 

Also, I don't believe that you need to use a sequence structure with that many frames. Since the VISA function have errors, that forces data flow. Since the wait function does not have error in/out terminals, it is common practice to encase the wait function with a sequence structure and pass the error wires through. Practicing this technique will ensure proper data flow without having to have a large sequence structure.

Tannerite
National Instruments
0 Kudos
Message 15 of 19
(1,946 Views)

Jstrike21:  I took the liberty of editing crossrulz submission and I attached it as a snippet.  I think the problem is:

1.  You send the start integration command before and after your wait.  Does your device need to run some amount of time (the wait) before it is ready to respond?

2.  I added a call to set the terminate read on receipt of termination character, so you don't receive a timeout error.

 

I hope this helps.

Modified Xitron Integration_BD.png

 

Bill

GCentral
0 Kudos
Message 16 of 19
(1,923 Views)

I am also currently working with the Xitron 2801 but I am currently trying to pull information I.E. volts amps watts every 0.5 seconds. The big problem I am facing is that the program just freezes up at random points during the test and you can't stop the test and does not produce any type of error; if you try to close the app it will say resetting vi:..... and you can't close that window. If you try opening another vi that requires a VISA application it will not work until you reset the computer otherwise there is just an error that pops up that says it can't access the VISA device. The frequency that this happens depends on the computer I am using and the computer I typically write the program on doesn't typically have any problems running this program. I think it has to do with how the Xitron interfaces with LabView. I am hoping someone here may have some experience with interfacing with the Xitron 2801 by sampling data at rates of 1 second or less. Or possibly have had similar problems elsewhere.

0 Kudos
Message 17 of 19
(1,863 Views)

You put your message on a thread which has been inactive for 8 months and is not really realted to that thread.

 

Please start a new thread with your question.  Mention that you had read this thread.

 

Post your VI.  Do you have VISA installed on the computer wherethe problem occurs?

 

Lynn

0 Kudos
Message 18 of 19
(1,849 Views)

Thanks for that John. It was the only discussion I found talking about the Xitron 2801, I made a new discussion for my question.

0 Kudos
Message 19 of 19
(1,826 Views)