How to get the analog value from the process data without the switching Bit in Rockwell Studio
Split IO-Link process data Byte of a sensor and move it in a variable with Rockwell Studio5000.
Related Products
SIG200-0A0512200 SENSOR INTEGR.GATE
WTB4FP-22161220A00Z2ZZZZZZZZZ1
Table of Contents
In this case we use a WTB4F and a SIG200 and would like to have only the current receiver level from the process data.
The process data of the WTB4F looks like this.
/msdyn_blobfile/$value)
The IO-Link data (process data) from port 1 of the SIG200 starts from Byte 8 in the input assembly.
/msdyn_blobfile/$value)
In the PLC you will find the input assembly like this. All variables are defined as data type SINT
/msdyn_blobfile/$value)
We would like to have the current receiving level without a negative sign in front and we would like to have it in one variable.
So in the first step we define a variable of the data type INT and give it a name, in this case I name it “Test_INT”
/msdyn_blobfile/$value)
In the next step we have to move Byte 8 and 9 into this Test_INT variable without the switching bits.
For this we use the function BTD (Bit Field Distribute) from the Rockwell Studio 500.
/msdyn_blobfile/$value)
Source = the byte (Tag) which contains the bits to move, in our case it is one time SIG200:I.Data[8] and SIG200:I.Data[9].
Source Bit = Lowest Bit number from where to start the move From Data[8] it starts from 2 and from Data[9] it stars from 0
Dest = Is the destination Byte (Tag) where to move the bits. In our case it is Test_INT
Dest Bit = The number of the Bit to which the data should be move. Data[8] should move to Bit 0 of Test_INT and Data[9] should move to Bit 6 of Test_INT.
Length = number of Bits to move. From Data[8] we move 6 Bits and from Data[9] we move 8 Bits.
In the program it looks like this.
/msdyn_blobfile/$value)
At the End you have the current receiving level in one variable without negative sign in front
The process data of the WTB4F looks like this.
The IO-Link data (process data) from port 1 of the SIG200 starts from Byte 8 in the input assembly.
In the PLC you will find the input assembly like this. All variables are defined as data type SINT
We would like to have the current receiving level without a negative sign in front and we would like to have it in one variable.
So in the first step we define a variable of the data type INT and give it a name, in this case I name it “Test_INT”
In the next step we have to move Byte 8 and 9 into this Test_INT variable without the switching bits.
For this we use the function BTD (Bit Field Distribute) from the Rockwell Studio 500.
Source = the byte (Tag) which contains the bits to move, in our case it is one time SIG200:I.Data[8] and SIG200:I.Data[9].
Source Bit = Lowest Bit number from where to start the move From Data[8] it starts from 2 and from Data[9] it stars from 0
Dest = Is the destination Byte (Tag) where to move the bits. In our case it is Test_INT
Dest Bit = The number of the Bit to which the data should be move. Data[8] should move to Bit 0 of Test_INT and Data[9] should move to Bit 6 of Test_INT.
Length = number of Bits to move. From Data[8] we move 6 Bits and from Data[9] we move 8 Bits.
In the program it looks like this.
At the End you have the current receiving level in one variable without negative sign in front
Keywords:
Rockwell, Allen Bradly, WTB4F, SIG200, Ethernet/IP, integration, IO-Link, process data
Rockwell, Allen Bradly, WTB4F, SIG200, Ethernet/IP, integration, IO-Link, process data
