15 - 08 - 2018

SNMP

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

 

AltonaLab library

Block AltonaLabMainWnd:

The block allows easy control of the main application window.

Block's inputs:

  • MinimizeWnd - When the input becomes to a high level, the AltonaLab application is minimized;
  • MaximizeWnd - maximizes the application;
  • RestoreWnd - restores the previous view of the application;

 

 

 

DateTime library

AltonaLab software allows mathematical and logical operations over DateTime type signals.

 

Block CurrTime:

The block's output value is the current computer time.

 

 

Block TimeInfo:

The block provides information about the components of the InTime input and show them to the corresponding outputs Year, Month, Day, Hour, Minute, Second, Milliseconds, DayOfWeek (from zero:Sunday to six:Saturday)


Block TimeDiff:

The block subtracts the two inputs InTime1, InTime2 and shows their difference as the integer outputs of the block. The outputs Larger at high level means InTime1>InTime2, the output Equal in high level means InTime1=InTime2, the output Less in high level means InTime1<InTime2.

 

 

Block TimeConst:

The block outputs time corresponding to its parameters: Year, Month, Day, Hour, Minute, Second.

 

 

Block TimeInPeriod:

The block checks how the input CheckedTime is related with period of two times InTime1 and InTime2. The block's outputs are:

  • Larger - means CheckedTime>InTime2;
  • InPeriod - means InTime1<=CheckedTime and CheckedTime<=InTime1;
  • Less - means CheckedTime<InTime1;

 

Block AddSubTime:

The block allows adding / subtracting days, hours, minutes, seconds to the time of the input In. Whether we add or subtract depends on the parameter Type that has values Add, Substract.

 

 

Block TimeElapsed:

The block shows the elapsed time from the start of the diagram. The work of the block can be temporary stoped using input Enable. The values of the outputs can be cleared using input Clear.

 

DataSet Controls

ppBlock DataSetImage:

The block allows visualization of more than one analog or digital signals together. The InDataSet input must be connected to the output of a block containing data, such as DataSetStorage, DBFStorage, SQLSelect.

 

Parameters:

 

  • DataSet - with this parameter we set which columns from incoming dataset from InDataSet input will be displayed. It is important to add a column, which exists in the incoming dataset from InDataSet input, its name to be written in the same way and to be of the same type. For example, if the incoming InDataSet is connected with an output of a block DBFStorage, the DBF has a column with name X of the analogue type, then in the DataSet parameter of the DataSetImage block we must also add a column named X of the same signal type.

Many analog and digital signals can be added, but only one type of DateTime. A DateTime signal is used to resize the X axis graph.

 

For analogue signal we can set color, min/max drawing values, size of the marker. If the input signal is incremental, we can check Incremental, first dot is zero. Good example for incremental signal is Rain - every new value of the signal is with added new rain for the period.

For digital signal we can set display levels of the ON/OFF values.

  • PeriodType - can be one of WholePeriodInDataSet, LastSeconds, LastMinutes, LastHours, LastDays. This parameter works together with parameter Last. For example, if PeriodType is LastMinutes and parameter Last is 10, the last 10 minutes from the input dataset InDataSet will be shown. If inputs FromPeriod, ToPeriod are connected, parameters PeriodType and Last are ignored.
  • Last - works together with parameter PeriodType;
  • Connect to Image control - the block has to be connected with control, which can be added from icon Controls - Image control;

 

Block's inputs:

  • InDataSet - the input DataSet, which data will be shown;
  • DoDraw - when the input becomes to high level, the control connected with this block will draw the data contained in the input InDataSet;
  • FromPeriod, ToPeriod - when this inputs are connected, parameters PeriodType and Last are ignored. The inputs the define the drawing period.

 

Block's outputs:

  • OnReady - becomes to high level after every redraw of the connected control;

 Good example of DataSetImage is a DBF.nsm diagram, which is in the Demo files.

 

Block DataSetTable:

With this block, we can visualize the contents of Dataset and move on it. The InDataSet input must be connected to the output of a block containing data, such as DataSetStorage, DBFStorage, SQLSelect. Every added column at the block will appear as column at the connected table and a new block output will be added with the same name and data type as the column. When the diagram is started and user move the selected row at the Table control, the values of the block's outputs will be changed with the values of the selected row. The numer of rows in the Table controls are the same as the numer of records of the input DataSet.

Parameters:

  • Columns: with this parameter we set which columns from incoming dataset from InDataSet input will be displayed on the Table control. It is important to add a column, which exists in the incoming dataset from InDataSet input, its name to be written in the same way and to be of the same type. For example, if the incoming InDataSet is connected with an output of a block DBFStorage and the DBF has a column with name X of the analogue type, then in the Columns parameter of the DataSetTable block we must also add a column named X of the same signal type.

We can add columns from analogue, digital, integer, string, DataTime data types as is shown below.

 Every column has the next settings:

- Name - the name of the DataSet column;

- Grid column text - This text will appear as column name at the Table control. If this setting is empty, the Name will appear as text at grid column;

- Column width - the width of the column at Table control;

- Visible - we can show/hide the column. If we need the column as Output of the block, but we not want to see the column at the Table control, we have to uncheck this setting;

For analogue column we can set a format setting for cells at column - Digits after decimal separator. For DataTime column the format setting is a Date time format, we can set it manually or to choose from one of the existing formats at combobox and to press the button Set;

  • OnReloadGoTo - sets which row to be selected when the block's input Reload becomes to High level or the diagram is just started. Posible values are Top, Botom, Nothing - means No action, SelectedRow - means the block will get the value of input SelectedRow and will select this table's row;
  •  Connect to table - the block has to be connected with Table control;

 

Block's inputs:

  • InDataSet - the input DataSet.
  • Reload - when the input InDataSet is changed, the input Reload has to become to high level, then the Table control will be refreshed with new DataSet values;
  • SelectedRow (Ingeter data type) - the index of the row to be selected;
  • SetSelectedRow - when the input becomes to high value, the block gets the value of the input SelectedRow and selects this row;
  • GoTop - when the input becomes to high value, the top row of the Table control will be selected;
  • GoBottom - when the input becomes to high value, the top row of the Table control will be selected;
  • Disable - disables the Table control;

 

 Block's outputs:

  • CurrRow - (Integer data type) the index of the current selected row;
  • OnSelChanged -the output becomes on high value when the user changes mannualy the Table's row;
  • OnReloaded - when the Table control is refreshed;
  • Every added column at the Columns property appears as block's output;

 

Blocks DataSetComboBox, DataSetListBox:

The blocks have the same behavior, input and outputs as the DataSetTable block. The difference is that when adding the columns to the Columns parameter, only one of them can be marked as Shown. This means that the contents of the ComboBox/ListBox will be filled in with the values of this DataSet column. The number of rows in the control is the same as the records in the input InDataSet. Each added column will appear as the block output. When selecting a new row from the ComboBox/ListBox, the block outputs will accept new values from the corresponding InDataSet record. 

 

Block Chart:

The block allows visualization of more than one signals together in Chart control. The InDataSet input must be connected to the output of a block containing data, such as DataSetStorage, DBFStorage, SQLSelect.

Parameters:

  • Chart - sets the Caption and Type of the visualization of the Chart control.

Chart Type may be one of the following:

  • Series - with this parameter we set which columns from incoming dataset from InDataSet input will be displayed on the Table control. It is important to add a column, which exists in the incoming dataset from InDataSet input, its name to be written in the same way and to be of the same type. For example, if the incoming InDataSet is connected with an output of a block DBFStorage and the DBF has a column with name X of the analogue type, then in the Series parameter of the Chart block we must also add a column named X of the same signal type.
    One of the added columns must be declared as Leading (checked at the first column at DataSet editor interface), this means that it will be shown on X axis, all others will be on the Y axis.

 

  • Use UpperLimit - if this parameter is checked, all the signals with values over UpperLimitValue will be shown in color from parameter UpperLimitColor;
  • UpperLimitValue;
  • UpperLimitColor;
  • Disable - the block will not work at started diagraml
  • Connect to ChartControl - the block has to be connected with Chart control;

 

 

 

DBF DataBase

Block DBFStorage

The block combines great possibilities for easy DBF database design, automatic base index creation, fast read / write operations on the base, self-maintenance of the database, and old records are erased, so the base is maintenance free.

DBF Database design:

The design of the DBF database can be set through the DataSet property. An interface opens in which the user can add the columns of the database and indicate what type they are - Analogue, Digital, Integer, DateTime, String. There is only one feature here, one of the columns entered for DateTime type should be declared a leading one, it means that an index will be created automatically on it - just check the CheckBox on the table of the property at column LeadingDate. The listed columns of the database will appear as block inputs. When adding a new database record, the values of the columns in the record will be taken from the current values of the inputs.

 

Parameters:

Common Parameters:

  • DataSet - for DBF Database design;
  • Disable - if the parameter is checked, the block will not work on a running diagram;
  • FullDBFFileName - includes device, path, filename with DBF extension. If the path is not valid, the block will not start;
  • StoreType - may have one of the following values: LastRecords, LastSeconds, LastMinutes, LastHours, LastDays. Works in combination with the StoreLast parameter. For example, if StoreType is LastMinutes and StoreLast is 10, the block will delete all the records older than 10 mins automatically.
  • StoreLast - defines the number of stored records in the database;
  • StoreLastAtMemory - defines the number of stored records in the memory. Each new record is added simultaneously to the database and to the block memory. The OutDataSet output of the block contains only the records added to the block memory. The number of supported records in the database and in the memory may be different.

 

Parameters related to exported records - for some database applications, the records may need to be periodically exported and uploaded to a FTP server, for example. For such needs, the following parameters have been developed:

  • ObjectID - if the database has a column with name ObjectID and with type Integer, all newly added records will have the value specified in this parameter. This is an important parameter if at a later stage the new records are exported and then imported into a common database, so we will distinguish the source of the data records;
  • SavePath - path of the exported file;
  • SaveType - may have one of the following values: DBF, Comma Separated (Text file);
  • SaveLastType - may have one of the following values: AllRecords (exports all existing records), LastRecords (exports last records determined from parameter SaveLast), OnlyNewRecords (exports only newly added records);
  • SaveLast - this parameters is used only when parameter SaveLastType is LastRecords;
  • Save_AddObjIDToFile - the value of parameter ObjectID will be added to exported file name;
  • SaveAsZIP - exported file will be archived;
  • Save_NextNumZipName - if the exported file is archived, the name of the file will contains a sequential number that will increase with one for each next export;

 

Block's inputs:

  • Append - when the input becomes to high value, a new record will be added to the database and to memory of the block. Then the output OnReady will become in high level for a short time and the otput OutDataSet will contains the new record too;
  • DeleteOld - deletes old records in the database and at the memory;
  • Reload - loads again all the records from the database to the memory - the output OutDataSet will be refreshed;
  • DoSave - exports the stored records in database to extenal file (DBF or Text);
  • SaveDriveLetter - the drive of the saved path can be changed runtime with this parameter. It has to contain only one character;

 

Block's outputs:

  • OutDataSet - contains all the records of database, related to parameters StoreType, StoreLastAtMemory;
  • OnReady - becomes at high level, when new record is added;
  • NumRecords - number of records currently in database;
  • OnSaved - the exported file is saved;
  • OnSaveError - becomes in high level in case of export error;

 

For example, please open DBF.nsm demo file.

Подкатегории