Advanced channel functions
The window allows you to add a calculation that will be sent as an additional MQTT signal in the selected topic. In doing so, no calculation is created in catman, the calculation exists only in the MQTT data stream. In the current version, only one FFT calculation is available.
Select a topic and access the advanced channel functions by clicking on under the topic channel list (Channels).
If you activate Publish only calculations, not the original values but only the calculations will be transmitted.
MQTT Configuration
Use MQTT config to specify the MQTT broker and the options for the data transfers.
You can specify both an IP address, a computer or a server name in the IP address field. The Port is set automatically when you select the security mode, but you can change it.
The Client Identifier (Client Id) identifies each MQTT client that connects to an MQTT broker. The broker also uses the Client Id to determine the current status of the client. Therefore, this Id should be unique per client and broker.
Whether username and password are required depends on your MQTT broker.
The same applies to the Security mode. Different modes are supported in the current version. Each security mode uses a different port. Therefore, the port is automatically changed to the default port when you select a mode. However, brokers may use other ports, so check the broker you are using.
Extended MQTT settings
The Automatic reconnection on option allows you to reconnect if contact with the MQTT broker is lost. catman will then try to reconnect in the time specified in the Reconnecting time field. The default value is 5 seconds.
MQTT DAQ settings
If desired, you can (temporarily) deactivate the MQTT data transmission. In this case, all settings (topics and channels) remain unchanged. Otherwise, the data is sent by catman after the start of a DAQ job and as long as it is running. No data is sent during the setup phase of a DAQ project or after the DAQ job has been stopped.
Extended MQTT settings
The Automatic reconnection on option allows you to reconnect if contact with the MQTT broker is lost. catman will then try to reconnect in the time specified in the Reconnecting time field. The default value is 5 seconds.
MQTT DAQ settings
If desired, you can (temporarily) deactivate the MQTT data transmission. In this case, all settings (topics and channels) remain unchanged. Otherwise, the data is sent by catman after the start of a DAQ job and as long as it is running. No data is sent during the setup phase of a DAQ project or after the DAQ job has been stopped.
Additional settings
The additional settings allow you to specify the buffer (expressed in the number of data points) used to determine the moving average of the signal into the MQTT JSON array (see Appendix for more information).
MQTT-Status
As soon as data acquisition is running in catman, the MQTT group in the Visualization tab shows you the status of broker and data stream.
Broker and Transmit green: the connection to the MQTT broker has been made and data is being transmitted.
Broker green, Transmit yellow: the connection to the MQTT broker has been made, but no data is being transmitted (MQTT data transmission OFF in the options).
Broker red, Transmit yellow: the connection to the MQTT broker has failed, the transmitted data cannot reach its destination. Check the settings of the MQTT broker.
Both LEDs are yellow: the MQTT broker is visible, but a connection is not possible Check user and password as well as the security mode.
Both LEDs are red: data collection is not running, no connection has been established and no data is being sent.
Creating Alarms
You have several options to create alarms in catman. However, for use in MQTT you have to convert each alarm into a channel, because only channels are sent via MQTT.
Method 1 - Computation channel
This is the simplest method. Create a computation channel that packages the alarm into a channel that switches from the default value of zero to an alarm value.
To do this, call up the Edit computation window via New (DAQ channels tab, Computation channels group). Open the list box under Additional functions, select if(Condition,True,False) and click . Then replace the texts Condition, True and False.
In the above illustration, the formula creates a computation channel that takes the value 1 when the StaticStrain1 channel exceeds the limit of 1500. As long as the StaticStrain1 channel does not exceed this value, the calculation always results in 0.
You can also create a symmetrical calculation if you want to monitor minimum and maximum at the same time. To check a minimum and a maximum value separately, you must create two calculations.
Method 2 - Auxiliary channel based on limit values or events
Limits and events are a standard catman function that you can use to organise alarm and warning conditions and that gives you more flexibility than creating computation channels. The disadvantage of this method is that transmitting the results to an MQTT broker requires an auxiliary channel and some EasyScript. However, part of the script is already preconfigured and you will find the commands still missing for this function in this section.
Each limit of the type High level crossing or Low level crossing can use two levels:
1. Warning level
2. Alarm level
The warning level must be smaller (in absolute values) than the alarm level. Selecting alarm and/or warning levels allows you to set a double alarm when monitoring channels, with the first level triggered by the warning value and the second level triggered by the alarm value.
Based on the triggered warning or alarm values, you can take various actions. The lower tabs of the window provide many options for selecting actions to be taken when the warning/alarm values are met. This alarm definition is assigned by selecting the channel on the DAQ channels tab and suing Assign (Limit values/events group).
However, these actions are limited to catman. To be able to send a notification via MQTT, you have to create an auxiliary channel and transfer the warning or alarm messages to it via EasyScript.
Click on Auxiliary channel (Computation channels group) and give the channel a name.
Click Edit script code in the dialogue to call up the catman EasyScript Code Editor. Part of the code for filling the auxiliary channel with values is already written, you just need to add a few lines.
Insert after the line Dim Count As Integer:
Dim Status As Integer
Insert before the line For Count = 0 To SampleCount - 1:
EA_DAQ.GetLIVState("Channel name", N, Status)
Here, Channel name is the exact name of the channel. Be sure to enclose it in quotes as it is a string (text). N is the number of the limit assigned to the channel. 1 is the first, 2 the second, etc. Status is the name of the variable you added to the declaration section.
Then replace the line 'MVBuf(1) = ... with
MVBuf(Count) = Status
and close the Code Editor.
Make sure you select a reference channel for the time interval before clicking OK and creating the auxiliary channel. This will place the auxiliary channel in the correct sample rate group. We recommend taking the channel that is being monitored.
The following is a code example for monitoring the first limit value assigned to a channel called RL01B: