PLC Variable Mismatch

I am working with a Turck PROFINET RFID reader head. You can see from the attached screen shots it is asking for a single PLC variable for the “input buffer byte” the scanned rfid tag value. But from the other screen shot you can see it really consists of 128 bytes. But neither Bytes or Byte Array seems to work.. I have tried all of the variable types but with no success. Thank you in advanced.

Hi Jason, There are a few interesting things about this situation that PLCnext Engineer doesn’t make quite clear. I will try to make it clearer: 1. If you click the little arrow I’ve highlighted below, you can see that the data type of that variable is Octetstring[128]. So you’re right, this is an array of 128 bytes. 2020 07 15 9 02 45 2. From this “Data List” window, it is only possible to connect to global variables that have been declared in the Global Data List. This is the way that I/O is connected in PC Worx 6, but in PLCnext Engineer it is recommended to use Port variables instead. And, port variables must be connected from a different window - the “Port List” window under the “PLCnext” branch of the project tree: 2020 07 15 9 12 14 3. From here, you should be able to connect the Input buffer byte variable to any variable that:

                                             * is a 128-element byte array
                                             * is declared as an **IN Port**
                                             * is declared in a program organisational unit (POU) that has been instantiated at least once in an ESM task.

4. Because PLCnext Engineer does not include a suitable data type by default, you need to declare your own custom type in a Data Type worksheet. This data type definition should look something like:

TYPE  
>      ByteArray128 : ARRAY[0..127] OF BYTE;  
>  END_TYPE

5. Once this type is defined, you can go ahead and create an IN Port variable of this type in your program, something like this: 2020 07 15 9 25 31 6. You should then be able to select the variable in the Port List window: 2020 07 15 9 28 31 If you still cannot select this variable in the Port List, please check that your program has been instantiated at least once in an ESM Task. Hope this helps. ~ Martin.

Hi Jason,</p>\nThere are a few interesting things about this situation that PLCnext Engineer doesn’t make quite clear. I will try to make it clearer:</p>\n1. If you click the little arrow I’ve highlighted below, you can see that the data type of that variable is **Octetstring[128] </strong>. So you’re right, this is an array of 128 bytes.</p>\n2020 07 15 9 02 45</img></p>\n2. From this “Data List” window, it is only possible to connect to global variables that have been declared in the Global Data List. This is the way that I/O is connected in PC Worx 6, but in PLCnext Engineer it is recommended to use Port variables instead. And, port variables must be connected from a different window - the “Port List” window under the “PLCnext” branch of the project tree:</p>\n2020 07 15 9 12 14</img></p>\n3. From here, you should be able to connect the **Input buffer byte </strong> variable to any variable that:</p>\n

                                             * is a 128-element byte array<\/li>\n
                                             * is declared as an **IN Port <\/strong><\/li>\n
                                             * is declared in a program organisational unit (POU) that has been instantiated at least once in an ESM task.<\/li>\n<\/ul>4\. Because PLCnext Engineer does not include a suitable data type by default, you need to declare your own custom type in a Data Type worksheet. This data type definition should look something like:<\/p>\n
                                                   
                                                   TYPE<\/samp>  
                                                   >      ByteArray128 : ARRAY[0..127] OF BYTE;<\/samp>  
                                                   >  END_TYPE<\/samp><\/pre>\n5. Once this type is defined, you can go ahead and create an **IN Port <\/strong> variable of this type in your program, something like this:<\/p>\n![2020 07 15 9 25 31](images\\/users\\/mboers\\/2020-07-15_9-25-31.jpg)<\/img><\/p>\n6. You should then be able to select the variable in the Port List window:<\/p>\n![2020 07 15 9 28 31](images\\/users\\/mboers\\/2020-07-15_9-28-31.jpg)<\/img><\/p>\nIf you still cannot select this variable in the Port List, please check that your program has been instantiated at least once in an ESM Task.<\/p>\nHope this helps.<\/p>\n~ Martin.<\/p>
                                                   Hi Martin,  
                                                   > Can you please reattach the screenshots. Most of them are missing.  
                                                   > Regards,  
                                                   > Arno  
                                                   >

Yeah sorry about that, it’s quite annoying that past updates to the back-end of this website have done this to old posts.

                                                   > I don't know how to restore the images to the original reply, so here's a copy of the reply with images included:  
                                                   > =============================================================================  
                                                   > 1. If you click the little arrow I've highlighted below, you can see that the data type of that variable is **Octetstring[128]**. So you're right, this is an array of 128 bytes.  
                                                   > [2020-07-15_9-02-45.jpg](https:\\/\\/forum.plcnext-community.net\\/uploads\\/PYGPBGH8JG1R\\/2020-07-15-9-02-45.jpg)2. From this "Data List" window, it is only possible to connect to global variables that have been declared in the Global Data List. This is the way that I/O is connected in PC Worx 6, but in PLCnext Engineer it is recommended to use Port variables instead. And, port variables must be connected from a different window - the "Port List" window under the "PLCnext" branch of the project tree:  
                                                   > [2020-07-15_9-12-14.jpg](https:\\/\\/forum.plcnext-community.net\\/uploads\\/EHUQBG42AJAU\\/2020-07-15-9-12-14.jpg)3. From here, you should be able to connect the **Input buffer byte** variable to any variable that:  
                                                   > 
                                                                                                      * is a 128-element byte array
                                                                                                      * is declared as an **IN Port**
                                                                                                      *  is declared in a program organisational unit (POU) that has been instantiated at least once in an ESM task.

4. Because PLCnext Engineer does not include a suitable data type by default, you need to declare your own custom type in a Data Type worksheet. This data type definition should look something like:  
> TYPE
    ByteArray128 : ARRAY[0..127] OF BYTE;
END_TYPE

5. Once this type is defined, you can go ahead and crate an IN Port variable of this type in your program, something like this:
2020-07-15_9-25-31.jpg6. You should then be able to select the variable in the Port List window:
2020-07-15_9-28-31.jpgIf you still cannot select this variable in the Port List, please check that your program has been instantiated at least once in an ESM Task.