Sign in to follow this  
Followers 0
marcinmrag

Pneumatic island valve with EtherCat protocol

4 posts in this topic

Hello,

I have pneumatic island which is control by the EtherCat protocol. Can someone explain my how to set a bit in a byte? One bit in byte is a coil of valve. I add this valve island to EtherCat configuration. In I/O maps i can find 85 output bytes and 45 Input bytes. I guess that i should create variable to this byte and then set bit in this byte. But How?

It's the way to address this bit directly? I did a test i used a Union : array 0...7 of BOOL and BYTE. Than I activate one of bool from array and the value of BYTE is changing and I MOVE This to variable with this same name like i put in I/O Map. But maybe is some better way to do it?

Edited by marcinmrag

Share this post


Link to post
Share on other sites

If you already creating a UNION Type which contains the same datatype as your required I/O Map, you can use that Type for I/O Map directly.

For your case, just create 85 Union Global Variables for outputs, and 45 Union Global Variables for inputs. Map those to your Pneumatic Island I/O Map. That way you don't need to use the MOVE instruction anymore.

Share this post


Link to post
Share on other sites

There are commands SetABit, ResetABit, OutABit, TestABit which are used for working with bits inside a byte, word, double word, etc.

They can be found in the Sequence Input and Sequence Output groups in the Toolbox.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0