08-09-2013 03:02 PM
Hi All,
I am very new to LabVIEW (just a couple of months). I need to communicate with a serial port of an Advanced Energy RF generator (Ovation) serial port (AE Bus)
The manual talks about little endian conversion, CSR and checksum that I just can't make it work. does anybody know how to write and read to this serial port?
I have used the write and read to serial port from examples with no luck and no response from the generator. I have attached the generator's manual here, the serial commands section starts at page 65 (4-25)
Has anybody written a program to talk to Ovation RF generator? can anybody help me out and get me started? I am stuck!!!. ... appreciate your help. thanks.
~Johnny
08-09-2013 03:28 PM
The instrument you attached the user manual for seems like it would be pretty straightforward to talk to (from a short glance at the manual), so have you been able to talk to anything through your serial port? Do you have any test equipment which you can practice writing to, something which would automatically display the data it gets, or perhaps even a second PC which you can set up a serial read/write also? Hyperterminal, which used to come with Windows? Do you have the right RS-232 (or 485, or whichever) cable that you need for serial communication (NOT a "straight-through" cable)? You've first got to make sure you can talk at all, then talk to the designated listener. At least that's how I had to do it. Then you work on the details like -endians, checksum, etc.
Cameron
08-09-2013 03:46 PM
Hi... yes, we have tried the hyper terminal and it works just fine.
Yes, I have tried writing to to the instrument's serial port with LabVIEW, but what I read back is always wrong.
I think I need to send the cmd and data separetly , do the little endian conversion then calculate the checksum for data before sending the data. and worry about CSR too. what should I do? Thanks
08-09-2013 04:10 PM
The manual says you send it all in one stream, including the checksum byte, which it tells how to calculate. You have determined the strings you're sending in hex, haven't you, not ASCII?
Just post a sample command, say 69: set serial port address and baud rate, let's see what your data stream looks like.
(but I may not be able to get back to you until Monday)
Cameron
08-09-2013 04:27 PM
Yes, I am sending the header, the cmd, the data and checksum in one hex string and what I read back is wrong.
I have to read the data from a text file, convert the decimal number from text to hex, then little endian it, then calculate the header, cmd and data bytes checksum , and then send it to serial write.... I think.
Thanks.
~ Johnny
08-09-2013 04:37 PM
Time for some code.
08-09-2013 10:45 PM
@Johnny-Come-Lately wrote:
Yes, I am sending the header, the cmd, the data and checksum in one hex string and what I read back is wrong.
I have to read the data from a text file, convert the decimal number from text to hex, then little endian it, then calculate the header, cmd and data bytes checksum , and then send it to serial write.... I think.
Thanks.
~ Johnny
All right, we can't help if all the information we have from you is "I think I'm doing it right, but the instrument isn't." We need to see some code and at least one sample input and output (generated in response to the input you enclosed).
Cameron
08-10-2013 09:41 AM
Thanks... so I started with the basic serial write and read, enetered hex text strings into the serial write, including the checksum and what I read back is not always correct because for example I need to calculate the XOR in the program and not just eneter it as a hex value. I should also put the write and read into a loop because I will be writing and reading to serial port 2 dozen times.
I am working with two devices, one is the generator, the other is a controller board that has a very similar serial bus structure as the generator's AE serial bus. the controller board has stepper motor drivers that move two variable capacitors. for the generator, I need to turn the power on and off and set to different power levels. for the control/stepper motor driver board: I need to read the values from a text file(attached). the text file has 3 table, table1, column1 is the number of steps that the stepper motor will move and column2 is the nominal capacitor values for C1. same thing table2; values are number of steps versus nominal cap values for C2. I need to creat a matrix such that to move the C1 to steps listed in the table, and for every step increment in C1, I need to move the C2 motor to 20 different position (listed in the table3 that has the desired percent value of total capacitance ) position and make a measurement of the impedance of the capacitors with agilant E5061 network analyzer and write the data back into the same text file at the end where it says "IMPEDANCE_REAL in Ohm one line per C1 position" and into a excel sheet too while taking a measurement... and do the same thing all over again for C2 versus C1. I think I need to use the producer consumer design pattern eventually when I get the details worked out first.
any suggestion? .... much thanks.
~ Johnny
08-10-2013 03:28 PM
so I did some digging and I found this post that says will talk to the generator. I haven't tried it on the generator yet, but it sends the header and cmd number separetely from the data bytes and calculates checksum too. I tried it on the controller board and it failed to communicate with the board. it does work on the laptop, as far as changing to little endian and calculating checksum. but not with the device or generator. my first vi talks to the board and i manually enter the hex code in the string constants to move the motors.
any suggestions? ... much thanks.
08-12-2013 10:57 AM
I can't see that anything you have done makes sense.
As I read the manual, the format of a command from the PC is on Page 4-19. According to this and the "Basic Serial Write and Read1.vi", you have said in CMD1 that you are going to address 2 (all numbers here are decimal), with 6 bytes of data, sending command 90, following with 7 bytes of data, and finally checksum 0C.
So, you have given a command which is not listed in the manual as being valid, your stated data length is not the number of data bytes you actually send, and your checksum (using "generate checksum.vi") should be 77. I can't comment on the address, because I don't know what you set up.
I would expect that, given this message, the instrument would send nothing back and wait forever, because, according to the message you sent it, you still owe it one byte before it can even acknowledge your message.
Cameron