With this method of data access, you are copying data to/from the module’s I/O memory directly to your function block’s local variables by using the GETIO/SETIO instructions. The I/O memory addresses for you module were assigned when you added the module to your project. The memory locations are dependent upon the order you added them to you project and the amount of memory used as defined in the DAP.
You are creating a function block called Block_1 and you want to read the input data from and write output data to the ConveyLinx module we created called workstation from our Topology Example. For your local static variables in your Block_1, you need to set the Data types for your in and out variables to be Array[0..31] of Word. To read data to the local in variable you need to use the GETIO function and to write data to the local out variable you need to use the SETIO function. Both the GETIO and SETIO functions require an ID parameter which corresponds to the specific module’s input and output memory.
|Create your Block_1 and set the Data type for the in and out variables. We know the workstation module is in Full PLC Mode so it requires 64 Bytes (32 Words) of input and output data|
|We need to find the Hardware Identifier for the inputs for the workstation module. Go to Ungrouped devices in the project tree, select the workstation module, select virtual input module, and select Properties|
|From here you can see that the Hardware identifier for the inputs for the workstation module is 274. Note this value because you will need it later when you configure your GETIO function.|
|Follow the same procedure from the project tree to select the virtual output module. From here you can see that the Hardware identifier for the outputs for the workstation module is 275. Note this value because you will need it later when you configure your SETIO function.|
|Here is the Block_1 program code showing the GETIO function utilizing the Hardware identifier value of 274 and putting the data to the in local tag. There is also code showing the SETIO function utilizing the Hardware identifier value of 275 and using the out local tag.|