I’m trying to communicate to an MKS Pressure Controller via the EPIC GRV-CSERI-4. I believe I have my communication handle setup correctly with my initial value of @MKS_946, baud=9600,parity=n,data=8,stop=1.
I’m trying to get back a pressure reading from the MKS Controller using their PN2 command but cannot figure out how to send that comment and receive back the pressure reading.
I’m trying to use a optiscript block with TransmitReceiveString(XMIT_MSG,PAC_5,RECV_MSG); as I found in the manual but I’m not sure if this is correct and if it is how do I send the PN2 command to the controller? Would I put the PN2 command after the above script? I think I’d have to change the Pac_5 to MKS correct?
Yes, you will need to swap out the example ‘PAC_5’ for your MKS comm handle.
Also you will need to put the PN2 command in the ‘XMIT_MSG’ string.
That should get you going.
If not, perhaps include a few screen shots and any errors you get to help us help you.
Sneaky edit… You will also need to check what the end of message delimiter is from the MKS pressure controller, its probably a line feed and or a carriage return, but check and set your end of message delimiter once you open your comm handle.
So am I going down the right path? I’m just trying to send the command PN2 to the MKS Controller. I’ve never done RS232 before so this is all new to me. I’m not sure what you mean by PN4 needs to be a string.
Yes, you are on the right path, you just need to get your 4 parameters correct and it will probably start working.
Your OptoScript command needs to look like this;
TR_Status = TransmitReceiveString(XMIT_MSG, MKS, RECV_MSG)
In your strategy tree on the left, make two strings, one XMIT_MSG and make its default value PN2.
Make another string RECV_MSG and leave its value blank.
Make an Int32 variable called TR_Status.
Now you should be able to download.
Once you get that working, lets know and we can help you with the end of message delimiter.
I’m not sure if we created the “strings” correct as we created them in the string variable. Is that the correct place for the XMIT_MSG and RECV_MSG? We put our PN2 (or other commands) in the initial valve line as we don’t see the “default Value” that you mentioned.
So I think now whats happening is that the receive is waiting for the end of message delimiter.
We have not set that yet, so I think its still waiting.
I tried to Google ‘MKS Pressure Controller’ and did not get any solid hits.
Do you have a manual for it?
If so, look what the end of message delimiter for the communications is.
I do have the manual. Let me look at it and find that. Also, now in my XMIT screen I’m getting the Rn1 command in my value block when running the strategy.