Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary Signals through serial with VISA

Solved!
Go to solution

Hello all,

 

I'm coming to the forums because I feel like I've tried everything else already. I want to control an AE paramount rf generator unit through a serial port. However, I can't quite make it work.  Essentially, I want to send the following binary signal ( 000010000000001000001010 ), which should be valid according to the below structure and the commands in the manual.

 

 

Jacobi_Friedman_1-1693339529908.png

However, I get the timeout error : VISA: (Hex 0xBFFF0015) Timeout expired before operation completed. So I believe either

 

1) my configurations are incorrect.

 

(From manual)

Jacobi_Friedman_2-1693339567983.png

 

(Sample configurations, I've tried many)

 

Jacobi_Friedman_3-1693339713072.png

 

Jacobi_Friedman_4-1693339744665.png

 2) I'm not handling the handshaking correctly. However, I can't read anything thats being sent back due to the timeout error. Handshaking according to manual:

 

Jacobi_Friedman_0-1693339499425.png

 

3) My final thought is that I'm not sure how to handle the 'start bit' the manual references, as VISA gives no option for that.

 

Can anyone offer any insight into my problems? It would be greatly appreciated. I'm very new to using National Instruments.

 

0 Kudos
Message 1 of 11
(746 Views)

Hi

can you send a vi with what you tried. Maybe we see what is wrong.

greetings from the Netherlands
0 Kudos
Message 2 of 11
(696 Views)

I actually haven't tried to do anything with labview yet. Thats the next step. However I'm unable to send test commands through NI-VISA.

 

Do you believe I would have more success with a Labview VI than with sending commands through VISA?

0 Kudos
Message 3 of 11
(684 Views)

Sure, because you need a handshake with ack and that is doable in LabVIEW easier than in MAX.

Open the visa session, send the bytes (in a string) read one character etc.

 

In LabVIEW make sure that all vi's that have an error-in/error-out are connected.

That is the way to make sure that no parallel actions happen.

And I can make an example, but which version of LabVIEW do you have?

greetings from the Netherlands
0 Kudos
Message 4 of 11
(681 Views)

I'm using Labview 2016 at the moment. I really appreciate your assistance.

 

I'm not really sure how handshaking works, but I I'm unable to use the 'read' function in VISA at all to read anything the device is sending back. I mention this in case you believe that will be an issue for the Labview VI.

0 Kudos
Message 5 of 11
(676 Views)

Hi

I will edit a vi, probably this evening, but are you sure that you did not swap pin 2 and 3 (recieve and transmit) ? On the instrument side.

greetings from the Netherlands
0 Kudos
Message 6 of 11
(668 Views)

I believe I have not.

 

The reason I think this is that I can actually control the generator already using the software that comes with the machine, through that very same cable/serial port. I need to control it with labview for my experiments, though. However, I am not quite sure what crossing the pins/wires would look like. This was a standard, pre-purchased wire. And the 9-pin serial connector can only fit one way.

0 Kudos
Message 7 of 11
(656 Views)

I agree that that is not the problem.

I'm trying to generate an example that fits your first mail.

greetings from the Netherlands
0 Kudos
Message 8 of 11
(646 Views)

So, I've been reading a ton of the forums. I've done some testing around in labview with the below VI, however I've yet to receive any signal back from the machine. Not even an 'unknown command' signal. My approach is very basic, as I still don't grasp the overall concepts involved. I'm trying to send the basic hex command '08020a' to tell the machine to start outputting power.

 

Unfortunately I'm still not sending the correct commands. I'm worried I'm not correctly handling this 'start bit' and 'end bit' that the manual says should be there. Labview says it handles the end bit, but I don't understand how. Similar question: should there be h's appended to the end of the commands I'm sending, or is that just there in the handshaking diagram (in first post) to indicate that these are hex numbers?

 

One important thing I noticed is that the machine is little endian, while labview is big endian. However, if I understand correctly all this means is that I should reverse the order of the hex bytes I send. I've had no success with that, either.

 

I've attached a 4 page version of the communication protocol with the unit. I'm still hopeful that this is a simple problem that won't take too much of anyone's time to solve.

Download All
0 Kudos
Message 9 of 11
(566 Views)
Solution
Accepted by topic author Jacobi_Friedman

I cleaned up your VI some.  The main issue I saw was your display mode for the strings.  The device is using a Binary protocol, so you want all of your strings to display in Hex.  Also, make sure the Termination Character is turned off (Boolean on the top of the VISA Configure Serial Port).  After that, it is a matter of following the framing protocol.  The below example is based on the example in the document.  You will need to alter things depending on the message you are trying to implement.


GCentral
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
Download All
Message 10 of 11
(559 Views)