RS-232 Communcation

I cannot find anywhere in their manual that talks of a message delimiter. Would it be the FF as seen in this photo of the manual?

Odd, but yes, it looks like every command ends with ‘FF’.
Use this command from page 118 of the command reference guide to get setup;

I added another communications handle and set the initial value to SetEndOfMessageTerminator(MKS,’ff’);

This is the result we are getting:

You will need to read the command reference closely, the end of message is not the character itself, but the ASCII value.
Also, it is a command, not a comm handle value.
You use the command after opening the comm handle.

Looking closer at the manual snipit I sent above it looks like the ; is the delimiter.

So I but command in the open communications script like below:

Is this correct? Assuming my delimiter is ;

I can compile with no errors but still don’t get any data out.

Yes, that looks much better.

Can you try the example in the manual?
@003PR1?;FF
That should give some data back?

Also, look at the tx/rx LED’s when you run your code, see if you can ‘see’ the data flash on the LEDs.
Lastly, the manual mentions 5 different baud rates, do you have the correct one set?

Should the state in the communication handle screen say open if I’m communicating? It says closed right now.

I’ve tried that example and it won’t let me compile.

I’m not sure if I’m typing that command into the right location?

…and yes the Baud Rate is set for 9600 in this optoscript and on the MKS Unit.

The @003PR1?;FF goes in the XMIT_MSG string, replacing the ‘PN2’ that is in there currently.

I replaced the PN2 with the @003PR1?;FF and it’s acting different but I’m not getting any data back.

Also my TX RX never blink.

Why is the comm handle now blank?
It should be the same as in this post; RS-232 Communcation - #29 by shawn.strange

EDIT, also I notice now that your XMIT_MSG is also empty, it should have the message you want to send to the meter in it.

Hmmm…I’m not sure why that is black in that screen shot. I just stopped the strategy and restarted it then reopened the windows and they are populated again.

The comm handle still says closed and my TX/RX lights on the controller are not blinking.
image

I think I’m really close to getting this. I can’t ever get my comm handle status to say open. Do you think that’s my problem? Something wrong in my Comm Handle Settings?

Ah…it was blank because I forgot to start the strategy.

Hi Shawn,

Is this the manual for your device?: https://www.lesker.com/newweb/process_instruments/pdf/manuals/kjlc-mks_946_controller-manual.pdf

It shows it having an address. What is the address of your device? Sending random bits across the wire and expecting a reply is good way to drive oneself crazy. Time to stop guessing and read the manual.

The default address is 253, so if it is still on the default, then I would send this command from the example:

@253PR1?;FF

Don’t worry about setting a delimiter at this point. Also, to machines, “ff” is different than “FF”, so make sure you use the correct case.

I don’t see a “PN2” command in that manual I linked to, but maybe it is the wrong manual. It would be nice if you told us what you were trying to talk to and linked to the manual. I only found that one by googling some of the text of your picture.

Philip,

Yes, that is the manual of the pressure controller I’m trying to communicate with. It is setup for the 253 address. I have tried using the @253PR1?;FF and I get the same results. If you look at page 97 on the MKS946 manual the command to receive the pressure reading from the controller is PRn (n = the channel of the controller your wanting to read). I have cards in all four channels so I can use PR1 - PR4. On page 97 of the MKS manual it also tells me the responses I should receive.

I think I’m still having issues with Open Outgoing Communications as when I run the strategy and open up my comm handle the status is always closed. I’ve tried using both an Action Block and OptoScript to establish a connection and I can never get my comm handle status to show open. Shouldn’t the status show open once the communication has been established?

If using the GRV-CSERV-4 do I have to write number to I/O Unit Memory? I thought I read somewhere that with the GRV-CSERV-4 I don’t need to do this? I just want to make sure I’m not missing a step?

Trust me I know the feeling about sending random bits down the wire will drive one crazy. I know I’m missing something simple.

I appreciate Opto’s help on this. Again I’ve never setup RS-232 coms before. I’m very green at this. I appreciate your patience in helping me.