22 - 10 - 2017

Controllers library

Block FTDI


The block works with the next FTDI chips:

  • FT245BL, FT245BM: Every of 8 IO pins of this device can be set as digital input or digital output. The important for this device is, that it works well in Asynchronous mode, so please set the parameter Mode of this block to value Asynchronous.

FT245BL Data Sheet:
http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245BL.pdf

Compatible devices:
UMP2: USB to 8-bit Parallel FIFO Interface Module:
http://tools.asix.net/download/museum/usb/ump2_en.pdf

  • FT245RL: The chip has 8 IO pins, which can be set as digital input ot output, but works well with Synchronous mode, in case we use Asynchronous mode, the device will works too, but every reading of digital inputs will be slowly, because TimeOut of 1 sec will appears.

FT245RL Data Sheet:
http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245R.pdf

Block's parameters:

  • CommunicatePerSec - the seconds per which the commands for Read/Write operations will be send to device. If this parameter is 0, the commands will be send per every DiscreteTime interval described in block Process.
  • FTDI_Device - this is a ComboBox with enumerated all the FTDI devices available on the current computer. The user has to select one of available FTDI devices.
  • Disable - If the diagram is started without connected device to computer, the process will be stopped automaticaly, because the device is not accessable. In this case if Disable parameter is checked, the process will be started without device.
  • InvertOuts - the digital outputs of the device are presented as block's inputs. If the hardware after FTDI chip inverts the digital outputs, then it is more easy to invert all the signals, which enter into the block than to use NOT digital block to invert every input signal.
  • Mode - this parameter is very important, because some of the FTDI devices work well in different modes. Please read the difference between FT245BL and FT245RL chips above;
  • Purge -if the parameter is checked, then on every I/O operation, a SCADA software will purge the communication port and this will ensure that every command to device is processed. "Purge" decreases the communication speed with device. If the parameter is unchecked, the communication speed can be increased up to 1000 commands to device per second.
  • IO - the parameter opens GPIO interface and it is very easy every IO to be set as digital input or digital output. More for GPIO interface can be read here:

 

Block outputs:

  • CommunicationError - becomes to hight level if the device does now respond to the computer's command;
  • OnRead - bocomes to hight level when a data is received from the device;

The important output of the block is CommunicationError. Is case the device USB cable is very long, cable is disconnected or for other reason, some of the commands between computer and device can be not processed from device, then the described output will become to hight value for 3 sec.

Demo - FTDI.nsm file:

 

 

Block SNMPcontroller

It is used for controlling the Internet/Ethernet module (IP controller) via SNMP protocol. The device can be at long distance at every poit of the world.

 

 

  • Digital I/O

The device has two registers with 8 I/O each. The names of registers are P3, P5. Every pin of this registers can be set as input or output.

  • Analog inputs

The device has a register P6 with 8 pins, all of them are 10 bit ADC analog inputs in range 0..3.3V.


Every IO of all registers are editable via GPIO interface, please read GPIO Strategy:

http://scada.altonalab.com/index.php/en/scada-design-mnu/inputs-outputs

When the diagram is started, AltonaLab will send all needful commands to determine the IO as inputs or outputs. Then the process will started. This will cost a few seconds.

 Parameters:

  • CommunicatePerSec - the seconds per which the commands for Read/Write operations will be send to device. If this parameter is 0, the commands will be send per every DiscreteTime interval described in block Process.
  • IP Address - IP address of the device;
  • SNMP R/O Pass - password for R/O operations;
  • SNMP R/W Pass - password for R/W operations;
  • InOut  – the parameter opens GPIO interface for manage pin type (digital/analog) and pin direction (input/output). More for GPIO interface can be read here: http://scada.altonalab.com/index.php/en/scada-design-mnu/inputs-outputs
  • SetIODirection - to send initial commands to device on every start of the process to set the I/O directions of ports P3, P5;

The important output of the block is CommunicationError. Is case the device not answers to the SNMP command, the output will become to hight value for 3 sec.

Device settings:

  • SNMP listen port: 161, this setting is important in case we need to forward the port via LAN router.
  • Defaul settings of the device are: IP port - 172.16.100.2, Password for Read/Write commands: private, Password for read only comands: 000000000000. On center of the device board is a jumper "Reset to Default". If the jumper is set and power up the device, then the device will be reset and default settings will be loaded. A few seconds after power up, the jumper have to be removed.
  • New device or device after reset, have to be connected directly to the computer via LAN cable (not through router). Then IP and mask of the computer LAN network connection have to be set to: 172.16.100.1, 255.255.255.0.
     
    All the device settings can be managed from third pannel Settings->SNMP Device settings:
     

Measuring temperature with the SNMP device and LM335 sensor:

LM335 allows negative temperature to be measured. It works in range -40..+100 degrees Celsius. The sensor increase the voltage with 10mV per every degree Kelvin. The conversation degrees Celsius to voltage is (AnalogInput - 2.7315)*100.0. This means that if the temperature increase over 56 degrees Celsius, the output voltage of the diagram above will exceed 3.3V and this can damage the analog input of SNMP device. It is possible to prevent damage using divisor with resistors but this will decrease accuracy of measurement.

More information about LM335:

http://pdf.datasheetcatalog.com/datasheet/texasinstruments2/lm335.pdf

 

 

Block GeigerCounterRH

Geiger Counter DIY Dosimeter Nuclear Radiation Detector DIY Kit from Radio Hobby Store:

http://radiohobbystore.com/geiger-counter-dosimeter-nuclear-radiation-detector-diy-kit-with-lcd.html

Parameters:

  •  ComPort - index between 1 and 99 of PC COM Port on which the counter is connected

Outputs:

  • CPM - Count per minute