INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

NModbus4 - PLC Master to PC Slave listen event?

NModbus4 - PLC Master to PC Slave listen event?

(OP)
I have an Automation Direct DL06 setup in a peer to peer configuration. The PLC is the master and the PC is the slave. The ladder logic is straight forward, just sending a double word (4 bytes) from the master starting a V3000 to PC. I've set V3000 to "Test". See below:



When the ladder logic runs the DataStoreWrittento event fires and the code below is my attempt to get the value "Test" from the modbus data store. Instead of getting "Test", I get 25940 and 29811... I would appreciate any assistance getting the "Test" value out of memory.

RE: NModbus4 - PLC Master to PC Slave listen event?

My guess is that you're being confused by expecting text values, but are getting decimal number results.

i.e. 25940 is a decimal value. Converting to hex gives you 6554. Looking at these characters in an ASCII table indicates 65 is e, and 54 is T. I've not checked to see if your second value lines up.

Thus, you've probably got a big endian / little endian issue, and you're looking at raw data values but expecting them to be parsed into ASCII for you to read.

RE: NModbus4 - PLC Master to PC Slave listen event?

Nice Freddy!! I was suspecting exactly that too but wasn't seeing it due to the endian aspect.

Keith Cress
kcress - http://www.flaminsystems.com

RE: NModbus4 - PLC Master to PC Slave listen event?

(OP)
Thanks for the feedback Fred and itsmoked. The 25940 and 29811 are of data type ushort. Please see solution below:

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close