On 5/15/2013 12:48 AM, Todd Zuercher wrote:
> I have a Modbus question. I hope there are some Modbus gurus listening.
>
> I am trying to use mb2hal to control a bunch of VFDs on a gang router .
> I have successfully gotten mb2hal to communicate with the drives but...
>
> Several of the registers of these drives use a format of "A chain of two 8 
> bit unsigned integers" to quote the manual.
> Basically the drive is using 1 register to write two different pieces of 
> data. The mb2hal component is writing both of these data points to a single 
> s32 pin. How do I separate this into the two numbers I can use. Is there a 
> component that can divide an s32 into 4 u8 numbers? Would I then have to 
> change the 2 u8 numbers I need back to u32 numbers to be able to use them for 
> anything?
>
> I've also asked the question here.
> http://www.linuxcnc.org/index.php/english/forum/25-classicladder/26456-modbus-examples?start=30#34112
> A pdf copy of the drives manual is attached to the first post of the thread.
>
>    

You would be better off staying away from 8 bit data.  As I recall just 
about every thing that Modbus does is either bits or 16 bit registers.

If you have an option, which I think you do, stick with bits or 16 bit 
registers.  Everything else will be more difficult.

You can always make a custom hal component if you want to go that 
route.    Look at some of the existing components source code and read 
the manual.  It isn't very difficult, but I doubt that is the best
solution to your situation.

Dave Cole

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to