Omron Modbus TCP Read - Shift Results

bernie_carlton

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Yakima, Washington
Posts
6,413
(Note: also posted at MrPLC)

The results from a Function 03 (Read) splits the high/low byte of the returnd 16 bit words. Neither of the 4 bit shifts (SLD./SRD) seem to shift the correct direction across multiple words. Has anyone dealt with this? (CP1H with CP1W-MODTCP01-US adapter)
 
(Note: also posted at MrPLC)

The results from a Function 03 (Read) splits the high/low byte of the returnd 16 bit words. Neither of the 4 bit shifts (SLD./SRD) seem to shift the correct direction across multiple words. Has anyone dealt with this? (CP1H with CP1W-MODTCP01-US adapter)

Could you just multiply/divide by 16?
 
It's a tabel of 16 bit registers shifted by 8 bits across word boundaries. (High byte of one word shifted to the lower byte of the next lower addressed word. This is in the Modbus received buffer and is a normal artifact of Modbus. But other PLC's do the re-alignment for you. Not this one.) Neither of the provided multi-bit shifts work correctly across the word boundaries. If necessary I'll have to do a whole mess of masking and shifting. I'm hoping for a more elegant solution.
 
The Modbus Easy Master @ MrPLC has examples of doing this. With the Serial version, shifting bytes across & up/down is required to generate the send requests, as well as having to decipher the received message.

Creating a loop to do this is easy enough, I have done it in both ladder & ST in the past..
 
I wasn't saying 'Modbus' is the problem, it's the implementation in the PLC as you mentioned. In the AB Micrologix line and in AutomationDirect is done for you. My mind is now officially fried from staring at indexed moves. Back at it tomorrow.
 

Similar Topics

Hi There. I have PC to get few tags from PLC into C# windows forms application. What is the best and fastest way? I could not find Omron in...
Replies
3
Views
308
Hello Is possible to communicate an PLC Omron CJ2M CPU33 with HMI thorough Modbus TCP, if is possible, how? whats is de modbus map register Thanks
Replies
2
Views
4,632
Is it possible to use the same ethernet card (ETN21) for HMI connection and also for Modbus TCP/IP server, connection are via a standard switch...
Replies
11
Views
9,816
Hello; I have an acs800 ABB drive RETA ethernet module and cj1m cpu13-etn; I have configured driver and plc when I ping from PC, both of them...
Replies
2
Views
8,898
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
284
Back
Top Bottom