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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rs232 header problems

Hi,

 

I want to communicate with a Advanced Energy cesar generator via a RS232 port.

 

The protocol is given in the manual as can be seen below.

 

I already figured out how to generate the checksum via XOR but I´m confused with the header structure. The first question is, does LabView already generate a header for the communication via the VISA-ressource name? Since the commands already reach "my" generator, somehow a header has to be defined but I cannot find any hint in the VISA manual.

If this is the case, how can I get grab to this header because I need the structure for generation of the checksum values?

 

If no header is generated via VISA where do I get the 5 bit address from to generate a header myself?

 

Thanks for the help!

 

Greetings 

 

Message 1 of 12
(4,212 Views)

Ichbinich wrote:

I want to communicate with a Advanced Energy cesar generator via a RS232 port.

The protocol is given in the manual as can be seen below.

I already figured out how to generate the checksum via XOR but I´m confused with the header structure. The first question is, does LabView already generate a header for the communication via the VISA-ressource name? Since the commands already reach "my" generator, somehow a header has to be defined but I cannot find any hint in the VISA manual.

If this is the case, how can I get grab to this header because I need the structure for generation of the checksum values?

If no header is generated via VISA where do I get the 5 bit address from to generate a header myself?


I am almost sure the address is stored in the instrument, and it is set by the instrument panel in some way. You should find more about this in the manual. From your pdf file I see you can set the address to 0. This will enable you to do some command testing, If you do not find how to set the address. The Visa driver will not create this header for you. I have also included some help for you to generate the header byte

Good luck

 

Message Edited by Coq rouge on 04-24-2009 01:54 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 2 of 12
(4,200 Views)

Hi,

 

I'm also having trouble with the ceasar generator...

Also I'm not so good in Labview, could you explain your example.vi?

Is it correct, that:

numeric1 is Header

numeric2 is Command Number

numeric3 is optional length byte

 

or is it more complicated?

 

@Ichbinich, do you have a working program? Mind if you post it here?

 

Thanks in advance!

 

0 Kudos
Message 3 of 12
(3,866 Views)

Yes, I´ve got it working after a lot of trial and error.

 

I have attached the VI to generate the command to the generator. You have to input this command to the "VISA write" command from Labview. Feel free to ask if you have further questions.

Download All
0 Kudos
Message 4 of 12
(3,846 Views)

Thanks for your help! Now my Generator is working.

But you missed one thing, you need to send an ACK (06h) to the Generator or else it complains about timeouts.

0 Kudos
Message 5 of 12
(3,770 Views)

Yes, but you have to do this after reading the response from the generator (at least if you use a "get" command).

 

The Vis I gave to you are only the ones to generate the command to the generator. This command is then put into a "serial write". After this a "serial read" is carried out and then an Ack (06) is sent with a "Visa write".

 

Of course, if you are just sending "set" commands to the generator you wont need the "Visa read".

0 Kudos
Message 6 of 12
(3,760 Views)

Hi there,

 

I am also trying to set up seriell communication with my cesar generator. The message generator from Ichbinich does look quite resonable. However, I didn't manage to control my generator so far. Would it be possible that you poste an entire VI-programm including the initialization and all read and write steps to for example switch on the generator? That would be really great! Do I have to make any settings at the generator itself beside setting the baud rate. Which type of cable do I have to apply? I think it should be a 1:1 or do I have to use a Nullmodem one?

 

Thanks a lot for your help!

 

Best, nufan

0 Kudos
Message 7 of 12
(3,619 Views)

I dont think it helps you when I post the whole program I use because I am operating my recipient (including Cesar generator, valves etc.) completely with LabView.

 

But I have attached the "activate host port" Vi that tells the generator to work in remote mode. Just try if this programm works for you. If it does you should see something like "generator in remote operation" appearing on the generator screen.

 

If it does not work, you probably have to play with the generator adress. But all generators I have worked with up to now use the same adress which is "1" (this btw. not written in any documentation). I dont even know why there is such an adress or where you can change it. But the cesar support team doesnt know it either Smiley Surprised

 

I hope I have also attached all sub VIs I use, if not feel free to contact me again.... Someone who is more experienced in LabView than me might be able to do it with fewer programming but at least the program works 😉

0 Kudos
Message 8 of 12
(3,572 Views)

For some reason I cannot edit my message anymore...

 

The other answers you asked for:

 

As far as I can remember the cable is a "normal" 1:1 Rs232 cable, not a nullmodem one but that should be written somewhere in the manual. And no other settings than the communication protocol must be done in the generator. In principle it should work work if the communication settings are correct.

0 Kudos
Message 9 of 12
(3,565 Views)

Thanks a lot! The VI is working perfectly! The only thing that is missing in your attachment is the "interprete csr code" file. Especially the write to cesar routine is very helpfull. Although my programm looks similarly, I was not able to figure out my mistake to far)-;

0 Kudos
Message 10 of 12
(3,553 Views)