Jump to content
OMRON Forums

SENDP


rhombusvs
 Share

Recommended Posts

Hi I am trying to send get a PLC to send a few values of data back to a vb.net applicaiton.

I want to do this via unsolicited messages for two reasons, I am not intending to use pcommserver, and I can have the listening thread isolated from other comms.

 

I'm using a geobrick with ethernet comms and from other threads here I have seen that I should use SENDP "string to send".

To test this I wrote a small plc which should send "A string" once every second (see below)

 

OPEN PLC 29 CLEAR

I5412=1000*8388608/I10

While (I5412 > 0)

EndWhile

P2900=P2900+1

SENDP"A String"

CLOSE

 

In the PEwinExe32Pro2 in a watch window I monitor P2900 and I also have the the unsolicited tab open.

I do not see my message come even once and the P2900 increments once, the plc is still running which suggests that it is hanging on the sendP command.

 

So I have 2 questions,

1: why is it hanging - ie what have I done wrong and what params have I possibly not set

2: Is it even possible to construct a string with Pvar data in it. If I can not then I am scuppered

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

rhombusvs,

 

I checked your code and used it on my Turbo PMAC2 and I do get the "A String" show up in my PEWIN32PRO2 unsolicited messages tab. So I think it might be either the PEWIN32PRO2 that you're using at fault or if you have MODBUS firmware, the PCommserver is not listening for unsolicited responses.

 

On you next question: To send the value of a P variable as an unsolicited response, use the following syntax:

 

CMDP"P1"

 

This will send the respond of string "P1" to parallel port (in your case Ethernet) as if you had typed it in terminal window.

 

Regards,

Link to comment
Share on other sites

Hi RHOM,

 

Like Sina I installed your exact code directly to my Brick and it runs fine.

 

I get the "A String" msg in the UnSolicited Response and see P2900 counting up as expected.

 

If you want to call or email me I'd be glad to give you some one on one support with this...

-we can make sure you have proper pewin and setup correct

-i can send you my ivar settings to compare

-I also have a complete Visual Studio Example HMI program that has step by step details and example how to use PMAC events including the UnSolicited event so that your PMAC can send messages to your HMI, I'd be glad to share this with you as well.

 

So feel free to contact me directly:

Mike Esposito 919.435.1159 mesposito@deltatau.com

 

Link to comment
Share on other sites

rhombusvs,

 

I checked your code and used it on my Turbo PMAC2 and I do get the "A String" show up in my PEWIN32PRO2 unsolicited messages tab. So I think it might be either the PEWIN32PRO2 that you're using at fault or if you have MODBUS firmware, the PCommserver is not listening for unsolicited responses.

 

On you next question: To send the value of a P variable as an unsolicited response, use the following syntax:

 

CMDP"P1"

 

This will send the respond of string "P1" to parallel port (in your case Ethernet) as if you had typed it in terminal window.

 

Regards,

 

Hi Sina

Thanks for the quick reply

At least I now know it is something my end that is stopping it. I am running PEWin version 4.2.11.0 on Vista (in this instance).

I am not running any modbus firmware as far as I know.

 

 

Link to comment
Share on other sites

Hi RHOM,

 

Like Sina I installed your exact code directly to my Brick and it runs fine.

 

I get the "A String" msg in the UnSolicited Response and see P2900 counting up as expected.

 

If you want to call or email me I'd be glad to give you some one on one support with this...

-we can make sure you have proper pewin and setup correct

-i can send you my ivar settings to compare

-I also have a complete Visual Studio Example HMI program that has step by step details and example how to use PMAC events including the UnSolicited event so that your PMAC can send messages to your HMI, I'd be glad to share this with you as well.

 

So feel free to contact me directly:

Mike Esposito 919.435.1159 mesposito@deltatau.com

 

 

Hi Mike

I am running PEWIN ver 4.2.11.0 on vista. I had a suspicion it might be ivars but I could not spot the offending one in my config, so yes I would be most greatful to see if I have something strikingly different.

 

I am actually trying to solve a high speed data transmission issue, Tony Jacobs from DT UK was in the states trying to find a solution the other week. We have discovered that the PCOMServer is not a very efficient way for me to send my data to the Brick.

I have about 100 bytes of data to send which corresponds to a coordinate in six degrees of freedom that I must move to with the minimal delay. From what I have discussed with Tony and Farooq the PComServer transmits 1024 byt packets and either waits for this many bytes or pads the data.

my Data is as follows:-

X0.0000 Y0.0000 Z0.0000 A0.000 B0.000 C0.000 U00.0

Note the 7th data point is an open loop torque for another motor.

 

They suggested that I should be able to make my application quicker if I send my data via my own winsock interface and use an Ascii rotary buffer to control the motion, (they beleive I should be able to acheive better than 2ms per coordinate with this concept)

 

I am trying to find methods of getting data back from the brick so that I monitor the state of the tool (including the PR of the buffer). I also need to get the rotational angle of one of the motors back as this is an input to the coordinate generator (it is actually going to be a steeringwheel with force feedback).

 

If you think you can help I am happy to go offline.

 

Graeme

Link to comment
Share on other sites

Ahhh... the plot thickens...

 

-yes I understand the issue with PServer and byte size, as I think you see you can force it to "send immediate" if you wish, this will cause it to pad the packet and send right away... this is needed when for example using the rotary buffer and you get to the end, must send the last line of buffer code as "send immediate" true so it will flush the end of buffer...

--- but I have found you can't just send every line like this or you may get some lockup after a few 100 lines being sent

 

---if you got Andy on it you got the top man and he will get to the bottom for you app for sure... but I'm very interested in the solution and helping if I can, I do a lot with PServer and HMI stuff so am always looking for a better way or different way to do same thing that for some apps works better....

 

--- I assume you are using DPRam ?

-I'm not sure how fast this will work but if you were putting the values needed in DPram then you can read them on your HMI side using DPRam calls to Pserver instead of individual calls like GetResponse ....

-PServer in this case is handling the xfer of dpram from pmac side to pc side for you ... but I'm not sure at what rate ?... but maybe faster than needed ??? So is it possible to setup all your data xfer in DPram to get positions and states or register values ?

-if sending down moves that are being dynamically created in PC can also using the Binary Rotary buffer which runs thru DPram

 

--- So not sure I can help much more but maybe I can run some tests or help push to get a solution...

 

Regards,

mike

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...