cr-Instrument user guide
Getting Started
Setup Device Information
User Interface Design
pointAlert Mechanism
pointEvent Handling Design
pointDistributed Network Architecture
pointGlossary
dotAdvanced Guide



.Getting Started
dotDownload
cr-Instrument can be downloaded  from http://www.cloud-rain.com

dot
How to startup cr-Instrument:
Windows example: c:\run.bat
Linux example: $ sh run.sh
(Before start cr-Instrument, the Linux computer should install Java environment.)
(Java version : JDK 8)

point login
1. The default password for 'Admin' is 'admin'.
2. The default password for 'User' is '123'.
             
.Setup Device Information
point Station and Device Data
1. The information obtained by "station" is called "device data". There are four sources of device data, that is, there are four types of stations:
    (1) Serial port : The range is COM1 ~ COM255, for example COM2, each serial port is treated as one station.
    (2) Socket port : For example, 6601, each socket port is treated as a station.
    (3) TCP client : is the client side of the Socket server, the name format is "tcpclient@ip:port", for example tcpclient@192.168.45.73:12568, each TCP client is regarded as one station.
    (4) Read file line by line : Read the file line by line is also regarded as a station, so this type of data is also considered as "device data".


point Config device table
1. The key data for a  row is: station name+ device name + model name + Serial Number + Data  Name, i.e.: each row is for a data name. (Not a row for a device, if a device affords two data values, for example, temperature and humidity, then this device will be displayed in two rows)
2. Unless necessary, leave the master-id , device-id and dummy-id blank.


             
.User Interface Design
1. Move: CTRL  +  Up/Down/Left/Right  key.
2. Resize: Shift
+  Up/Down/Left/Right  key.
3.On the frame panel design, the symbol '%' indicates the percentage relative to the screen size.
   On other items design, the symbol '%' represents the percentage relative to the frame size.
4."Start button" and "Stop button"  are the same button, but the status is different. After pressing the "Start button", the realtime monitor status is set to "true". And, after pressing the "Stop button", the realtim monitor status is set to "false".


point.Alert Mechanism
point E-mail alert
  1.To send email, you must first apply an gmail as sender. (no limitation for receiver)
  2.The sending email computer must be setup before sending email , set it to 'low security'. For more detail, please google "gmail low security application".
  3.If still having problem, using "Sign in with the app password" option, in this way, google email system will produce an app password for sending email. (It is 16 byte length, and used only for app. This password can not be used to login gmail account.)


pointSMS (Short Message Service) alert
  1.To send message to phone, you must first apply an sms account from SMS service provider.
  2.The SMS service provider must afford the web function for sending message, for example:
      http://202.49.148.216/kotsmsapi-1.php?username=john&password=pw1234&dstaddr=0911876353&smbody=You_are_wonderful
  3.In the setup panel, you must setup the web function, for example:
       http://202.49.148.216/kotsmsapi-1.php?username=[#account#]&password=[#password#]&dstaddr=[#sendToPhone#]&smbody=[#message#]

point Sound alert
  1.Accepted sound file formats are *.mp3, *.wav and * .au.
  2.When playing sound, you can stop playing by press the 'ESC' key.

point.Event Handling Design
dotThe steps to add a new event handling, as shown below :
   eventsteps
    The steps are explained as follows:
     (1) Add an event, and an event code will be added to the event list, such as EV006.
     (2) Add a new condition, and a condition code will be added to the condition list, such as CD005.
     (3) Select the condition item, if there are parameters for the condition, then enter the required parameter values for the condition.
     (4) Add this condition to the event as a condition to trigger the event.
     (5) Add an action (that is, the action to be taken when the above conditions are met), and an action code, such as AC007, will be added to the action list.
     (6) Select the action item, if there are parameters for the action, then enter the parameter values required for the action.
     (7) Add this action to the event as the action to be taken when the event is triggered.

dotConditions: (There are two kinds of conditions: triggered event condition and non-triggered event condition)
      Triggered event condition:
            After connected
            After disconnected
            After system startup
            Any data
            Before system terminated
            Checkbox 01 action
            Checkbox 02 action
            Checkbox 03 action
            Checkbox 04 action
            Checkbox 05 action
            Checkbox 06 action
            Checkbox 07 action
            Checkbox 08 action
            Checkbox 09 action
            Checkbox 10 action
            Checkbox 11 action
            Checkbox 12 action
            Checkbox 13 action
            Checkbox 14 action
            Checkbox 15 action
            Checkbox 16 action
            Checkbox 17 action
            Checkbox 18 action
            Checkbox 19 action
            Checkbox 20 action
            Click button 01
            Click button 02
            Click button 03
            Click button 04
            Click button 05
            Click button 06
            Click button 07
            Click button 08
            Click button 09
            Click button 10
            Click button 11
            Click button 12
            Click button 13
            Click button 14
            Click button 15
            Click button 16
            Click button 17
            Click button 18
            Click button 19
            Click button 20
            Click button 21
            Click button 22
            Click button 23
            Click button 24
            Click button 25
            Click button 26
            Click button 27
            Click button 28
            Click button 29
            Click button 30
            Click connect button
            Click start button
            Click stop button
            Click file menuitem 01
            Click file menuitem 02
            Click file menuitem 03
            Click file menuitem 04
            Click file menuitem 05
            Click help menuitem 01
            Click help menuitem 02
            Click help menuitem 03
            Click help menuitem 04
            Click help menuitem 05
            Click tool menuitem 01
            Click tool menuitem 02
            Click tool menuitem 03
            Click tool menuitem 04
            Click tool menuitem 05
            Combobox 01action
            Combobox 02 action
            Combobox 03 action
            Combobox 04 action
            Combobox 05 action
            Combobox 06 action
            Combobox 07 action
            Combobox 08 action
            Combobox 09 action
            Combobox 10 action
            Combobox 11 action
            Combobox 12 action
            Combobox 13 action
            Combobox 14 action
            Combobox 15 action
            Combobox 16 action
            Combobox 17 action
            Combobox 18 action
            Combobox 19 action
            Combobox 20 action
            Data checked by Java class
            Database data
            Device data
            File data (binary)
            File data (text)
            Message 01 confirmed YES
            Message 01 confirmed NO
            Message 02 confirmed YES
            Message 02 confirmed NO
            Message 03 confirmed YES
            Message 03 confirmed NO
            Message 04 confirmed YES
            Message 04 confirmed NO
            Message 05 confirmed YES
            Message 05 confirmed NO
            Message 06 confirmed YES
            Message 06 confirmed NO
            Message 07 confirmed YES
            Message 07 confirmed NO
            Message 08 confirmed YES
            Message 08 confirmed NO
            Message 09 confirmed YES
            Message 09 confirmed NO
            Message 10 confirmed YES
            Message 10 confirmed NO
            Over upper alert level
            Over upper take-action level
            Radiobutton 01 action
            Radiobutton 02 action
            Radiobutton 03 action
            Radiobutton 04 action
            Radiobutton 05 action
            Radiobutton 06 action
            Radiobutton 07 action
            Radiobutton 08 action
            Radiobutton 09 action
            Radiobutton 10 action
            Radiobutton 11 action
            Radiobutton 12 action
            Radiobutton 13 action
            Radiobutton 14 action
            Radiobutton 15 action
            Radiobutton 16 action
            Radiobutton 17 action
            Radiobutton 18 action
            Radiobutton 19 action
            Radiobutton 20 action
            Schedule time
            Textfield 01 action
            Textfield 02 action
            Textfield 03 action
            Textfield 04 action
            Textfield 05 action
            Textfield 06 action
            Textfield 07 action
            Textfield 08 action
            Textfield 09 action
            Textfield 10 action
            Textfield 11 action
            Textfield 12 action
            Textfield 13 action
            Textfield 14 action
            Textfield 15 action
            Textfield 16 action
            Textfield 17 action
            Textfield 18 action
            Textfield 19 action
            Textfield 20 action
            Textfield 21 action
            Textfield 22 action
            Textfield 23 action
            Textfield 24 action
            Textfield 25 action
            Textfield 26 action
            Textfield 27 action
            Textfield 28 action
            Textfield 29 action
            Textfield 30 action
            Under lower alert level
            Under lower take-action level

      Non-triggered event conditions: (These conditions can not work alone, because they can not be triggered.)
            and in continuous monitoring mode
            and checkbox 01 checked
            and checkbox 01 not checked
            and checkbox 02 checked
            and checkbox 02 not checked
            and checkbox 03 checked
            and checkbox 03 not checked
            and checkbox 04 checked
            and checkbox 04 not checked
            and checkbox 05 checked
            and checkbox 05 not checked
            and checkbox 06 checked
            and checkbox 06 not checked
            and checkbox 07 checked
            and checkbox 07 not checked
            and checkbox 08 checked
            and checkbox 08 not checked
            and checkbox 09 checked
            and checkbox 09 not checked
            and checkbox 10 checked
            and checkbox 10 not checked
            and checkbox 11 checked
            and checkbox 11 not checked
            and checkbox 12 checked
            and checkbox 12 not checked
            and checkbox 13 checked
            and checkbox 13 not checked
            and checkbox 14 checked
            and checkbox 14 not checked
            and checkbox 15 checked
            and checkbox 15 not checked
            and checkbox 16 checked
            and checkbox 17 not checked
            and checkbox 17 checked
            and checkbox 18 not checked
            and checkbox 18 checked
            and checkbox 19 not checked
            and checkbox 19 checked
            and checkbox 19 not checked
            and checkbox 20 checked
            and checkbox 20 not checked
            and radiobutton 01 selected
            and radiobutton 01 not selected
            and radiobutton 02 selected
            and radiobutton 02 not selected
            and radiobutton 03 selected
            and radiobutton 03 not selected
            and radiobutton 04 selected
            and radiobutton 04 not selected
            and radiobutton 05 selected
            and radiobutton 05 not selected
            and radiobutton 06 selected
            and radiobutton 06 not selected
            and radiobutton 07 selected
            and radiobutton 07 not selected
            and radiobutton 08 selected
            and radiobutton 08 not selected
            and radiobutton 09 selected
            and radiobutton 09 not selected
            and radiobutton 10 selected
            and radiobutton 10 not selected
            and radiobutton 11 selected
            and radiobutton 11 not selected
            and radiobutton 12 selected
            and radiobutton 12 not selected
            and radiobutton 13 selected
            and radiobutton 13 not selected
            and radiobutton 14 selected
            and radiobutton 14 not selected
            and radiobutton 15 selected
            and radiobutton 15 not selected
            and radiobutton 16 selected
            and radiobutton 16 not selected
            and radiobutton 17 selected
            and radiobutton 17 not selected
            and radiobutton 18 selected
            and radiobutton 18 not selected
            and radiobutton 19 selected
            and radiobutton 19 not selected
            and radiobutton 20 selected
            and radiobutton 20 not selected

dotActions: (If the previous setup conditions satified, action will be performed.)
      Action sound alarm
      Alert sound alarm
      All station send command
      Append data to textarea 01
      Append data to textarea 02
      Append data to textarea 03
      Connect all port
      Database query
      Database update
      Disconnect all port
      Exit application
      First device send command
      First station send command
      FTP delete
      FTP download
      FTP upload
      Java class
      Log
      Next device send command
      Next station send command
      Open URL
      Operating system command
      Pause
      Play sound
      Read file line by line
      Restart application
      Read file line by line
      Read binary file
      Read text file
      Save to file
      Set data value
      Set device SN
      Send command
      Send email message
      Send SMS message to mobile phone
      Set text value
      Set textarea 01 value
      Set textarea 02 value
      Set textarea 03 value
      Set textfield 01 value
      Set textfield 02 value
      Set textfield 03 value
      Set textfield 04 value
      Set textfield 05 value
      Set textfield 06 value
      Set textfield 07 value
      Set textfield 08 value
      Set textfield 09 value
      Set textfield 10 value
      Set textfield 11 value
      Set textfield 12 value
      Set textfield 13 value
      Set textfield 14 value
      Set textfield 15 value
      Set textfield 16 value
      Set textfield 17 value
      Set textfield 18 value
      Set textfield 19 value
      Set textfield 20 value
      Set textfield 21 value
      Set textfield 22 value
      Set textfield 23 value
      Set textfield 24 value
      Set textfield 25 value
      Set textfield 26 value
      Set textfield 27 value
      Set textfield 28 value
      Set textfield 29 value
      Set textfield 30 value
      Set textlabel 01 value
      Set textlabel 02 value
      Set textlabel 03 value
      Set textlabel 04 value
      Set textlabel 05 value
      Set textlabel 06 value
      Set textlabel 07 value
      Set textlabel 08 value
      Set textlabel 09 value
      Set textlabel 10 value
      Set textlabel 11 value
      Set textlabel 12 value
      Set textlabel 13 value
      Set textlabel 14 value
      Set textlabel 15 value
      Set textlabel 16 value
      Set textlabel 17 value
      Set textlabel 18 value
      Set textlabel 19 value
      Set textlabel 20 value
      Set textlabel 21 value
      Set textlabel 22 value
      Set textlabel 23 value
      Set textlabel 24 value
      Set textlabel 25 value
      Set textlabel 26 value
      Set textlabel 27 value
      Set textlabel 28 value
      Set textlabel 29 value
      Set textlabel 30 value
      Show message dialog
      Show confirm message dialog 01
      Show confirm message dialog 02
      Show confirm message dialog 03
      Show confirm message dialog 04
      Show confirm message dialog 05
      Show confirm message dialog 06
      Show confirm message dialog 07
      Show confirm message dialog 08
      Show confirm message dialog 09
      Show confirm message dialog 10
      Start monitor
      Stop continue send command
      Stop monitor

dotParameter for transformation (mainly used in 1.set text field 2.set text label 3.db sql script 4.send sms msg 5.send email (subject and msg) 6.log as action  7.show option pane as action 8.java class as action (used this for parameter) 9.OS command 10.save to file as action 11.send command as action等)
      [#20#] =  " " (=space)
      [#space#] =  " "
      [#2c#] =   ","
      [#rn#] =  "\r\n"
      [#0d0a#] =  "\r\n"
      [#n#] =  "\n"
      [#r#] =  "\r"
      [#0d#] =  "\r"
      [#0a#] =  "\n"
      [#id#] =  my ID
      [#ip#] =  my IP
      [#cr_engine_version#] =  cr_engine version
      [#cr_wsn_version#] =  cr_wsn version
      [#computername#] =  computer name
      [#computeros#] =  computer OS
      [#computerarch#] =  computer architecture
      [#groupname#] =  group name
      [#nickname#] =  my nick name
      [#jvmversion#] =  jvm version
      [#jvmarch#] = jvm architecture
      [#ap_version#] = application version
      [#country#] =  country
      [#language#] =  language
      [#starttime#] = system start time, in "yyyy-MM-dd HH:mm:ss" format
      [#datavalue#] =  data value
      [#textvalue#] =  text value
      [#originaltime#] =  data time in ms
      [#originaldata#] =  original data value
      [#date#] =  date, in "yyyy-MM-dd" format
      [#datetime#] = date and time, in "yyyy-MM-dd HH:mm:ss" format
      [#time#] =  time, in "HH:mm:ss" format
      [#ci_version#] =  cr-instrument.version
      [#title#] = title with version
      [#textfield01#] =  textfield01 value
      [#textfield02#] =  textfield02 value
      [#textfield03#] =  textfield03 value
      [#textfield04#] =  textfield04 value
      [#textfield05#] =  textfield05 value
      [#textfield06#] =  textfield06 value
      [#textfield07#] =  textfield07 value
      [#textfield08#] =  textfield08 value
      [#textfield09#] =  textfield09 value
      [#textfield10#] =  textfield10 value
      [#textfield11#] =  textfield11 value
      [#textfield12#] =  textfield12 value
      [#textfield13#] =  textfield13 value
      [#textfield14#] =  textfield14 value
      [#textfield15#] =  textfield15 value
      [#textfield16#] =  textfield16 value
      [#textfield17#] =  textfield17 value
      [#textfield18#] =  textfield18 value
      [#textfield19#] =  textfield19 value
      [#textfield20#] =  textfield20 value
      [#textfield21#] =  textfield21 value
      [#textfield22#] =  textfield22 value
      [#textfield23#] =  textfield23 value
      [#textfield24#] =  textfield24 value
      [#textfield25#] =  textfield25 value
      [#textfield26#] =  textfield26 value
      [#textfield27#] =  textfield27 value
      [#textfield28#] =  textfield28 value
      [#textfield29#] =  textfield29 value
      [#textfield30#] =  textfield30 value
      [#textarea01#] =  textarea01 value
      [#textarea02#] =  textarea02 value
      [#textarea03#] =  textarea03 value
      [#combobox01#] = combobox01 selected value
      [#combobox02#] =  combobox02 selected value
      [#combobox03#] =  combobox03 selected value
      [#combobox04#] =  combobox04 selected value
      [#combobox05#] =  combobox05 selected value
      [#combobox06#] =  combobox06 selected value
      [#combobox07#] =  combobox07 selected value
      [#combobox08#] =  combobox08 selected value
      [#combobox09#] =  combobox09 selected value
      [#combobox10#] =  combobox10 selected value
      [#combobox11#] =  combobox11 selected value
      [#combobox12#] =  combobox12 selected value
      [#combobox13#] =  combobox13 selected value
      [#combobox14#] =  combobox14 selected value
      [#combobox15#] =  combobox15 selected value
      [#combobox16#] =  combobox16 selected value
      [#combobox17#] =  combobox17 selected value
      [#combobox18#] =  combobox18 selected value
      [#combobox19#] =  combobox19 selected value
      [#combobox20#] =  combobox20 selected value

dot Button 01 is the button on the up right corner of the monitor screen, as following:
button01


point.Distributed Network Architecture
Distributed network architecture is necessary when remote monitoring is required, or when multiple devices need to be monitored simultaneously.

point Point-to-point connection
  1.Point-to-point connection by IP to IP
connection, as shown below.
 

connect

pointConnection setting screen
  1.The settings of the connection will appear after the program is started.
  2.Check "Connect to IP" and enter the IP value of the other party to connect, as shown below.

connect2

pointSecurity Mechanism
  1.Between each node, you must obtain the authorization of the other party to perform various control actions (such as opening and closing the socket port and serial port).
  2.
The security mechanism between each node is as shown in the following figure:When the command code passed by the other party meets my commandpw, it can get my authorization.

security2

   The password setting screen is as follows:
security3

point Multi-point connection
  1.When connecting multiple points, one principle must be observed:   Only one of the nodes is the root node. The green nodes in the following illustrations are the root nodes.
  2.There is no limit to the number of connection points, but when there are too many points and a large amount of data is transferred, the transmission rate may be affected.

     The following is an example of a multipoint connection.
connect3


       
The following is an example 2 of a multipoint connection.
connect4


     The following is an example 3 of a multipoint connection.
connect5

point.Glossary
dotByte data, String data, and Byte String data in Event handling setup:
 When receive byte data from a device, for example, if the byte values are {0x31,0x32,0x33}, then the string data is the string "123" (ASCII values as characters), and the byte string data is "313233". (hex value as string, and no space between each character )

dot.Advanced Guide
dotJava Interfaces
1.The interface of 'Java class for action' is ci.CIAction.java
, as follows:
   package ci;
   public interface CIAction {
      public void startAction(CrInstrument instrument,String actionCode,CIDataClass dc,String parameters[]);
      public void onExit(int type);
  }

2.The interface of 'Java class for checking data' is ci.CIChkDataClass.java, as follows:
   package ci;
   public interface CIChkDataClass {
        //The input data format is in hex mode, ex: 'E5 F6 45 65'.
        public boolean chkData(String data);
   }

3.The interface of 'Java class for sending command' is ci.CIDataGenerator.java, as follows:
   package ci;
   public interface CIDataGenerator {
      public byte[] getData();
   }

4.The interface of 'Java class for transforming data value' is ci.CITransferClass.java.
   package ci;
   public interface CITransferClass {
       public double getValue(double value);
   }


5.The interface of  'Java class for welcome panel' is y.ylib.WelcomePanel.java, as follows:
   package y.ylib;
   public interface WelcomePanel {
      public void setVisibleOff();
      public void setVisibleOn(int arg0, int arg1, String[] arg2);
      public void setValue(int arg0);
      public void setEstimatedTime(int arg0);
  }


              Any other questions, please post it on cr-Instrument forum.