MVP 2023 Flex727 Posted September 24 MVP 2023 Report Share Posted September 24 I am developing a project with a USC-B5-B1 PLC using UniLogic 1.33.373. I want this PLC to be a Ethernet/IP Adapter (Target) and provide data that is organized as a vector of 30 bits that it has collected from elsewhere. When I try to create the Adapter Node, I get an error message in the Output Size column that says "Mismatch: a bit vector must be in multiples of 8 to accommodate bytes." What would be the best or proper way to set this up? Do I need to copy the data to 4 other vectors of 8 bits each, or just list each of the 30 coils individually, or what? It will not let me select a single element of the vector. (Edited to add screen cap) Link to comment Share on other sites More sharing options...
Dave Posted September 25 Report Share Posted September 25 I think it may be easier to manipulate the data at the other end, if each coil had an integer associated with it. Coil is OFF, write 0 to integer(INT8). Coil is ON, write 1 to integer. Reverse the operation at receiving end to get back to bit data. Its a bit more code to write, but not to complicated. After some more thought.....while I think that should work, I don't think its the "proper" way to do it. I'm not sure how you gathered the bit data together, but can you make the vector length 32 bits and just include a few dummy bits? 1 Link to comment Share on other sites More sharing options...
Gabriel Franco Posted September 25 Report Share Posted September 25 Create a 32 bit array tag (Output_Array_EIP) to be used as adapter output and copy origin 30 bit array (Array_Bit_Origin) to this new array of 32. 1 Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 25 Author MVP 2023 Report Share Posted September 25 Thanks @Dave & @Gabriel Franco. That worked. All it wanted was for the vector to be evenly divisible by 8. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now