Search the Community

Showing results for tags 'structures'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 1 result

  1. Hi, This is going to be a long question, but I want to be thorough so please bear with me. We have a system consisting of ABB equipment for motion control and IO handling. In order to simplify the overall architecture, we want to replace the motion control part of this system (which at present consists of a bunch of different CPU cards and PCBs) with one Omron NJ controller an use its SW library for motion control instead. With regards to IO handling we want to leave the IOs as they are now and just map them from the ABB PLC to the NJ controller and back using an Anybus X-gateway (i.e. the ABB PLC will collect the IOs from its modules, send them via Profinet to the Anybus, which will map them on EtherCAT to the NJ controller). Now, in the NJ controller, rather than putting all the IOs in the global variable list, I want to create structures (one Digital Input structure consisting of booleans, one Analog Input structure consisting of long reals and so on). The reason I want to use a structure rather than an array, is that the structure let's me specify variable names, which is nice. Here is my problem: How can I map the digital inputs from the Anybus to the Digital Input structure? The data from the Anybus is packed into bytes of data, so I want to find the most convenient way to take these bytes from my IO-table, split them up and map them to the bools of my structure. I can't seem to find good solutions to this problem online. From the Omron Instruction docs W502, the function AryByteTo seems to do exactly what I want, but it seems like my output variable in that case needs to be an array instead of a struct. If I don't find a good solution to this I am stuck with just hard coding every DI to its variable in my struct, which is time consuming to say the least considering well over thousand IOs. Hope someone will help. Thanks in advance.