Ventuz only supports General Purpose Inputs even though the hardware is able to support both Inputs and Outputs.
To use a GPI with Ventuz Designer or Runtime you will need to create a configuration file that provides Ventuz with information on which GPIO Board and which pins are used. To do so copy one of the below sample XML files to this location: [Public Documents]\Ventuz6\Configuration\GpioConfig\gpio.xml
Adjust the COM Port and the number of pins used if needed.
To use a GPI with Ventuz Director you will need to create a configuration file that provides Ventuz with information on which GPIO Board and which pins are used. To do so copy one of the below sample XML files to this location: [Public Documents]\Ventuz6\Configuration\GpioConfig\gpio.director.xml
<GPIO> <Devices> <Device> <LogLevel>Info</LogLevel> <Class>Ventuz.Kernel.GPIO.DLPDesign_DLP_IO8, Ventuz.Kernel.Shared</Class> <Port>COM4</Port> <Channels> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput Inverted</ChannelType> </Channels> </Device> </Devices> </GPIO>
<GPIO> <Devices> <Device> <LogLevel>Info</LogLevel> <Class>Ventuz.Kernel.GPIO.NumatoLab_USB_GPIO16, Ventuz.Kernel.Shared</Class> <Port>COM5</Port> <Channels> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput Inverted</ChannelType> </Channels> </Device> </Devices> </GPIO>
Pins can also be inverted, simply add " Inverted" to the desired Channel.
Adjust the COM Port and the number of pins used if needed.
If you want to use a GPI board only in one application of the Ventuz Software Suite, we speak of Exclusive GPI. It means you can use the GPI device either in Ventuz Director or in Ventuz Runtime/Designer. However, there can be the case you want to have both to control logic from within a Ventuz Scene on the one hand and to trigger commands in Ventuz Director on the other hand. In this case we are talking about Shared GPI and the commucation with the hardware is not done by the Application but through the Ventuz Machine Service. In addition to the handling of simultaneous access, we also benefit from the fact that the GPI board does not have to be physically installed into the machine in which it is actually used, because the communication is done via websocket handled by the Ventuz Machine Service.
To use Shared GPI we need to configure two different things: the GPI_Service hosted by the Ventuz Machine Service and the Application related configuration as descibed in the General Configuration section.
As mentioned above, the Ventuz Machine Service is hosting the GPI_Service. To configure it simply open a browser and navigate to the following url.
http://localhost:21404/Persistence_Service/1.0/keys/SharedGPIO.Config/action/set
You will get a small configuration window that allows you to paste a configuration json in there and apply it by pressing Set Value.
The configuration allows you to add one or more Devices with the following attributes (name/value pairs).
Ventuz only supports General Purpose Inputs even though the hardware is able to support both Inputs and Outputs.
Sample GPI_Service config
{ "Devices" : [ { "Class" : "Ventuz.Kernel.GPIO.DLPDesign_DLP_IO8, Ventuz.Kernel.Shared", "Port" : "COM1", "Channels" : ["DigitalInput, Inverted","DigitalInput"] }, { "Class" : "Ventuz.Kernel.GPIO.NumatoLab_USB_GPIO16, Ventuz.Kernel.Shared", "Port" : "COM2", "Channels" : ["DigitalInput","DigitalInput"] } ] }
Pins can also be inverted, simply add ", Inverted" to the desired Channel.
Second we need to make sure the configuration file for Ventuz Designer and Director are located in the correct folder as descibed in the General Configuration section. In those files we need to adjust the
<GPIO> <Devices> <Device> <Class>Ventuz.Kernel.GPIO.VMSSharedGPIO, Ventuz.Kernel.Shared</Class> <Port>http://localhost:20404/GPIO_Service/1.0/statews1</Port> <Channels> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput</ChannelType> <ChannelType>DigitalInput Inverted</ChannelType> </Channels> </Device> </Devices> </GPIO>