Page 1 of 1
Read from gateway into array
Posted: 20 May 2019, 17:55
by mirko.comparetti
Hello,
Suppose I have an I/O device (like AIO or DI/DO/DIO) and I want to configure the variable associated with the physical I/O pins to the field of an array. Would that be possible from pictory, assuming I'll use the proper array data type?
Thanks,
Mirko
Re: Read from gateway into array
Posted: 21 May 2019, 10:45
by dirk
Dear Mirko, unfortunately there is no array access possible. But in PiCtory there exist "variants" for the DI/DO/DIO modules. Here you may switch the IO variables to 2 bytes.
So you could set all the inputs or outputs of one module via one variable.
Re: Read from gateway into array
Posted: 21 May 2019, 11:17
by mirko.comparetti
dirk wrote: ↑21 May 2019, 10:45
But in PiCtory there exist "variants" for the DI/DO/DIO modules.
Hello Dirk,
Thanks for your reply. And what about the AIO? Is there something similar for that?
We are thinking of an application where we will have multiple RevPi with different AI and we are writing a code that is "general purpose" and it reads a configuration file that we will write in every device. The possibility of using a "generic" access to the IO variables will help a lot and ease the deployment of multiple devices.
Thanks
Re: Read from gateway into array
Posted: 21 May 2019, 12:53
by dirk
Dear mirko.comparetti, no the AIO is not designed to support this byte access as this are analog values. But in this case you can create your own RAP file for your own device in PiCtory -
Tutorial 25 – Create your own RAP file
Re: Read from gateway into array
Posted: 21 May 2019, 16:43
by mirko.comparetti
Hello Dirk,
Thanks, so basically I can create a new version of the AIO rap file to work with arrays? Did I undestood this correctly?
Thanks,
Mirko
Re: Read from gateway into array
Posted: 22 May 2019, 07:47
by dirk
Dear Mirko, I am not sure if I understood your requirement and also if a customized RAP file may help you. But this could be a point in your research that you can put into discussion for your project stakeholders. So just have a look at the documentation and there is always more than one way to solve a problem. So for example there are also Virtual Modules that just lets you reserve free space on the process image. You could also customize this module so that you can access the data according to your needs and write a small program that fills it with the data of the AIO module.