Tag Archive: applications

Web Pages have been added for Bundled Software Applications! These web pages have been implemented to make configuring the Bundled Software easier. This post will go over the different tabs the Bundled Software Pages have.

To start, there are 5 tabs available on the Bundled Software Pages. Other then the On Boot page, each tab should display different registry settings to configure a different application in the Bundled Software.

On Boot Page

The On Boot tab is the opening tab when the Bundled Software Pages are loaded. Instead of letting you edit the registry keys of one of the applications like the other tabs, this page allows you to set which Bundled Software Applications will run on boot. Keep in mind that when setting one of the these applications to not start on boot, you won’t be able to access that applications tab in the Bundled Software Pages until its enabled again.

Serial Control

Serial Control can accept one or more connections from an external device and this connection can be over the serial port and/or the Ethernet port. The Serial Control tab allows you to edit the registry keys of Serial Control from the web page. Below is a quick explanation for each field.

  • Incoming Termination String – Sets the string that Serial Control looks for at the end of each message sent to it to know if that is the end of message being sent.
  • Outgoing Termination String – Sets the string that Serial Control adds to the end of each message it sends. The external device being sent to needs to know to look for this Outgoing Termination String.
  • Send Counts – Determines if the JNIOR reports each time an input changes to the external device connected through the Serial Control Connection.
  • Send Date Stamp – Determines if each report of an I/O change on the JNIOR reported through the Serial Control Connection gets appended with the current data and time.
  • Send Unsolicited I/O Alerts – Determines if any Alert such as I/O Counts or Date Stamps should be allowed through the Serial Control Connection.
  • Serial Port – Sets the Serial connection that Serial Control connects on.
  • TCP Port – Sets the TCP port that Serial Control connects on.
  • UDP Port – Sets the TCP port that Serial Control connects on.

Serial-to-Ethernet

Serial-to-Ethernet lets you setup a connection between a device that can communicate via ethernet and a device that can only connect serially. The web page allows you to configure the port for the ethernet connection, the serial port of the serial connection, the host address of the device that the JNIOR will attempt to connect to if the external device only listens for TCP connections, and if the connection is maintained after being established.

Modbus

Modbus lets you setup a connection to the JNIOR using the Modbus Protocol. The Modbus tab on the Bundled Software Pages allows you to setup the port the Modbus Protocol uses, if login is required, and the amount of time in seconds without communication on the Modbus connection for it to timeout.

Slaving

Slaving lets you control the I/O on one JNIOR by monitoring the I/O of another. There are two tables on the Slaving tab, one for inputs and the other for outputs. Each input and output and on the JNIOR will be displayed in these tables, and from there can be set the I/O point they are slaved to, followed by the information of the external JNIOR that has that I/O point.

When using Cinema, Serial PLUS, or Serial-To-Ethernet applications people will be generally using the serial port to talk to other devices or send commands. Knowing what registry keys need to be set to when communicating on them is important. This tutorial is for setting the registry keys up for the Serial Control Plus application.

To start, when using Serial Control, the connection that will be set up is accessed through the command line once all the registry keys have been set. So first thing is to go to the support tool and go to applications. Once there make sure that the Serial Control application is checked, otherwise check it and reboot.

Configuration tab for JNIOR Web Page

Once the JNIOR reboots, go to the console tab and type “ps” to see if the application is running.

ps command for JNIOR command line

If it is then next go to the registry tab and in the section App-Data find the Serial Control program.

Registry tab for JNIOR Web Page

Here is where all the information for creating the serial connection is contained. If you are connecting through COM3 at the command line, make sure that the SerialPort value is set to AUX if the port being used is the Auxiliary port and not the RS-232 port. If you want to connect through TCP, make sure you set a TcpServerPortNumber value set, a good example one is 9202. Now all the values should be set to connect serially to the JNIOR. Go to the JNIOR support tool and select tools –> command line. This will bring up the command line to give serial commands to the JNIOR. 

JNIOR telnet session

When using Cinema, Serial PLUS, or Serial-To-Ethernet applications people will be generally using the serial port to talk to other devices or send commands. Knowing what registry keys need to be set to when communicating on them is important. This tutorial is for setting the registry keys up for the Serial-to-Ethernet application.

To start, when using Serial-to-Ethernet, the connection that will be set up is accessed through the command line once all the registry keys have been set. So first thing is to go to the support tool and go to applications. Once there make sure that the Serial-to-Ethernet application is checked, otherwise check it and reboot.

Configuration tab for JNIOR Web Page

Once the JNIOR reboots, go to the console tab and type “ps” to see if the application is running.

ps command for JNIOR command line

If it is then next go to the registry tab and in the section App-Data find the Serial-to-Ethernet program.

Registry tab for JNIOR Web Page

Here is where all the information for creating the serial connection is contained. Make sure that the SerialPort value is set to AUX if the port being used is the Auxiliary port and not the RS-232 port. Now all the values should be set to connect serially to the JNIOR. Go to the JNIOR support tool and select tools –> command line. This will bring up the command line to give serial commands to the JNIOR. 

JNIOR telnet session

Serial Control Plus is an application that comes pre-installed on all JNIORs. It allows you to connect either serially or through TCP to a JNIOR, and give it commands to activate the JNIOR’s I/O. This post will explain how to setup and use Serial Control Plus on your JNIOR.

As mentioned before Serial Control Plus is already pre-installed on all JNIORs. To activate it, you need to go to the JNIOR DCP. This can be accessed by either right clicking the JNIOR in the JNIOR Support Tool and going to Tools/Open Web Page, or by typing the JNIOR’s IP address into the URL of your computer’s web browser. Once on the DCP, you’ll go to the applications section on the configuration tab and click the checkbox next to Serial Control Plus and reboot your JNIOR. This will allow you to use Serial Control Plus on that JNIOR.

Configuration tab for the JNIOR Web Page

Once you have activated the Serial Control Plus application on your JNIOR, you can now send commands to the JNIOR through it. We are going to open the command line from the support tool to activate commands on this JNIOR for this example. To open the command line from the Support Tool, you’ll go to the Tools bar at the top of the Support Tool and select Command Line.

Command Line button on Support Tool

Once you have the command line open, you’ll need to configure the settings of the command line to send commands to the JNIOR. To have the right settings to communicate with the JNIOR, we need to select how we communicate to the JNIOR. Serial Control Plus can communicate with the JNIOR two ways. Either you can connect to the JNIOR with a serial connection or a TCP connection.

To connect serially with the JNIOR, you need to plug a serial cable into the Aux Port of the JNIOR. Once you do that we need to select the correct settings in the command line window. As in the picture below, next to the connect button for the connection type you’ll select COM, baud type is 9600, Data bits is 8, Stop bits is 1, Parity is none, and hardware/software is set to none. For the Option drop-down, select all the choices.

serial settings for JNIOR telnet session

To connect through TCP, you just need the JNIOR to be on the network to connect. As in the picture below next to the connect button for the connection type you’ll select TCP/IP, you’ll set the JNIOR’s IP, and the Port to connect on is 9202. For the Option drop-down, select all the choices.

TCP settings for JNIOR telent session

Once you’ve decided on your connection type and configured the command line accordingly, you should be able to send commands to the JNIOR. Here are commands for controlling and monitoring I/O.

Controlling I/O

The following commands can be used to close, open and pulse outputs.

cX: Close the output (relay is “on” closing the contact)
where x = 1 through 8 for the internal relay outputs on the JNIOR
and x = +1 through +8 for the external relay outputs on the 4 Relay Output Expansion Modules

oX: Open the output (relay is “off” opening the contact)
where x = 1 through 8 for the internal relay outputs on the JNIOR
and x = +1 through +8 for the external relay outputs on the 4 Relay Output Expansion Modules

p=yyy Pulse duration (milliseconds) and is used in conjunction with the ‘close’ or ‘open’ command


Examples:
c2p=1000 close output 2 for 1 second and then open again
c+2p=1000 close output 10 for 1 second and then open again
o3p=10000 open output 3 for 10 seconds and then close again
c* Close all outputs at the same time (includes internal and external)
o* Open all outputs at the same time (includes internal and external)


These commands can be abbreviated and used in combination, such as:
c1 close relay output 1
c+1 close relay output 9 (first output on first expansion module)
c+5 close relay output 13 (first output on second expansion module)
c1+1+5 combination of the above all in one command
c1234 close relay outputs 1 through 4
c1368 close relay outputs 1, 3, 6, 8
o125 open relay outputs 1, 2, 5
c1+1p=1000 close relay outputs 1, 9 and pulse each for 1 second simultaneously

Monitoring I/O

Whenever an input (or output) changes status (low-to-high or high-to-low), the following is sent out by the JNIOR:

INx=1 Input x (1 – 8) has gone high (on)
OUTx=1 Output x (1 – 16) has gone high (on)
INx=0 Input x (1 – 8) has gone low (off)
OUTx=1 Output x (1 – 16) has gone low (off)


The default setting for the Registry Key AppData/Serial_Control/SendCounts is false. If you change this key to true and reboot, with each message stating the input status, a count value will also be included. Whenever an input changes status (low-to-high or high-to-low), the following is sent out by the JNIOR:

INx=1,yyy Input x (1 – 8) has gone high (on), counter value = yyy
INx=0,yyy Input x (1 – 8) has gone low (off), counter value = yyy


Note: These monitoring messages are sent out individually over the serial port or Ethernet. The JNIOR does not report the status of more than one input/counter in the same message.

With this, you should now be able to use Serial Control Plus to control and monitor a JNIOR’s I/O!

Either when using a certain custom application, or creating one on your own, there may be a want to set an application when a JNIOR turns on. Many applications people use have this functionality, like Cinema. Here is the process for setting an application to run on boot.

NOTE: Before you can set the run key, you have to make sure that the application is installed on your JNIOR. If you are installing a custom application not in an update project, when adding the application to the JNIOR you should place the file in the flash folder since not only is that where we reference the program in this example, but its where applications on the JNIOR are kept when they are loaded on through update projects. So if you are installing an update project, the file will automatically be placed in the flash folder.

The way to make a project start on boot is by creating a registry key in the run registry of the JNIOR you want the application to be on. To access the registry of a JNIOR, you need to either open the support tool and right click a JNIOR to open a web page, or type the JNIOR’s IP address into a web browser URL.

Once you are on the JNIOR’s webpage, you’ll want to click onto the Registry tab. Going through the registry, you’ll want to find the run registry, and there you will create a new registry key for your application.

Once you are in the run registry folder, you’ll click new at the top left which will display the following dialog box.

In the key section you’ll want to type the name of your application so it will look like run/(application name). In the content section, you’ll want to enter the line flash/(application name).jar. This will make it so that when you boot your JNIOR, application will appear in your flash folder along with other applications.

For example, if we had an application called ExampleProgram that we wanted to run on boot we would enter in the key field ExampleProgram so it would look like run/ExampleProgram. Then in the content field, you’d enter flash/exampleprogram.jar, since that is where we placed the application previously.

The application won’t start running after that registry key is set, you’ll have to reboot after to get it to start. Once that registry key is created though, anytime the JNIOR reboots the application will launch when the JNIOR loads back up!

MODBUS client is not able to connect to the JNIOR

The MODBUS server running on the JNIOR is a separate application from the Operating System. It does not run by default when the JNIOR is shipped. It is installed by default. It must be activated by the end user before the the MODBUS connection can be successful.

To activate it go to the DCP, click on the Configuration tab. Half way down the left side click on Applications. You will see a list of applications that are loaded on the JNIOR. Check the box next to Modbus Server. This will tell the JNIOR to run the application when the JNIOR boots up. You will need to reboot the JNIOR at this point to get the MODBUS Server to start.

To verify that the MODBUS server is running we can list the listening network sockets using the netstat command.

Lastly, you can change a few configuration parameters for the MODBUS server under the registry tab.

Port 502 is the default MODBUS port. Most likely this will NOT need to be changed. The Timeout setting is the number of milliseconds to wait for a MODBUS client to poll the server. If a request is not made within this amount of time then the JNIOR will close the connection. If any configuration needs to be changed it will probably be the Login setting. Not very many MODBUS clients implement a login. If they dont log in then you will see the following in the Modbus Server log…

Setting the Login key to false will allow this device to connect successfully.