Using GRV-CSERI ports from a program

We are integrating a device using a RS-485 connection, and we have installed a GRV-CSERI to do this.

I have some questions:

There are some operations that we want to perform on this device when the strategy is not running.

From the shell account, I can see the that devices /dev/ttySerMod0.0 – /dev/ttySerMod0.3 have been defined.

  1. Can I write a linux program to directly write to these devices?

  2. If a strategy has been loaded, are that strategy’s I/O settings used to specify the # wires, termination, and bias settings for the device. If not, how can this be done? (I have looked at this forum post: Configure Epic Serial Module GRV-CSERI-4 but I do not see this question addressed in that post).

  3. Also, the GRV-CSERI requires that a termination mode and a bias setting by specified as part of the configuration. I have read this blog post:
    RS-485 - To Terminate, Bias, or Both?
    that describe what termination and bias are. It is somewhat helpful. If we selected the “Termination” option, is this the equivalent of adding a 120 ohm resistor to the communication lines?

  1. Great question. I don’t know. Will try and see what I can find out.

  2. If a strategy has been loaded, the module will use those config settings. If a strategy has not been loaded, then you can configure the port type via groov Manage.

  3. https://documents.opto22.com/2296_groov_Serial_Modules_Data_Sheet.pdf
    It mentions in there that the termination option is 120 ohms.

I found a few things out and from that have inferred the answer is ‘should be possible’.

Here you can see the shell program ‘minicom’ receiving data from a GPS receiver sitting on my desk (it was the only serial device I could quickly put my hands on).

You can see I have set the baud rate to 9600, 8 data bits, No parity and 1 stop bit.
I did this from within Minicom. Since I can do it there, I am inferring that you should be able to set the comm port parameters from the Linux program.
Note that I still used groov Manage to set the serial port type (in my GPS case, RS-232).

Note also that /dev/ttySerModx.x is symbolically linked to ttyUSBx
If you do an ‘ls -la’ on the /dev directory, you can see that link. (This took me a hot minute to figure out why the ‘SerMod’ device was not working as expected. EDIT-Found out it was a typo, it works as expected using either the module or the mapped device).

(Note that my groov Serial I/O module is in position 3 on the rack).

EDIT. Found the ‘stty’ command.
http://man7.org/linux/man-pages/man1/stty.1.html
This would be the way to change via a program the serial port settings.

IMPORTANT EDIT. I have found that if you run Node-RED and PAC Control with serial commands addressing the same serial port, you get undesired results. I would expect the same would happen if you tried to use another program to access the serial port at the same time as either of these two methods… In short, pick one method and use it exclusively.

1 Like

Thank you – I will try this out.

I am pulling my hair out with Modbus RTU and the GRV serial module via RS485

I got “somehwere” using the pac control modbus toolkit but not what I wanted. So I started playing with node red. Do the serial module TX and RX lights still light up when accessing the serial module from Node Red?

Another thing, I see the GROOV IO READ node does not support the serial module? Any reason for that?

Yes. The LED’s are hardware, they don’t care which software is addressing them.

The groov IO nodes are primary for talking directly to the IO points on EPIC or even more so RIO.
The serial module is already well supported with the Node-RED serial node which is the correct node to use in this case. node-red-node-serialport (node) - Node-RED
Install the node and click on add new, then click on the search;

The serial module will be found and you can configure the baud rate etc.

1 Like

As the serial port package requires a higher version of node-RED, I wasn’t able to install this. Instead I opted for the Modbus Package.

I am only getting errors - plus confusingly, the Modbus Server is asking for a Unit ID for what I am assuming is the ‘master’ (ie the CSERI-4 Module).

Below is my configuration - I have tried to do some reading regarding the naming convention of the serial modules, so I think I’ve got it right in that regard. The CSERI-4 module is in the first [0] available position in my rack, and I have a slave wired in to the second channel of the module (channels 12, 13, RS485 2 wire termination bias).

These are the errors I’m getting:

This is the groov setup:

And then finally, the Modbus nodes setup:

Any help would be appreciated!!

@Beno

Update on my situation: I have made some sort of progress. The TX light now flashes sometimes, and my settings are as pictured below, however I’m still receiving errors, and now a ‘timeout’ error.

The serial node is not used or needed for serial modbus, so I think we can put that one behind us.

The device ID needs to be the same in both locations.
Its the ID of the device (not groov) that you are talking to.
Usually you can find it via its menu or documents. It must match the device, you cant just put anything in there.
Same goes with the baud, start, stop and parity bits. They must match the modbus serial port of the device you are talking to.

A screenshot of your flow would be helpful.

Here is my flow. I just have a basic setup just so I can get it working, then I’ll implement our control logic and data store comms later down the track.

I have only one slave PID attached and this is unit ID 10. In the Modbus Server Config I have set the unit ID to 10, and the same in the Modbus Read node config.

EDIT: I have checked the baud, parity, stop bit settings of the device and they are all correct in my node settings.
Modbus Poll Settings:

image


*these settings work when testing through Modbus Poll Program on my laptop.

Final update - I am yet figure out why, but I think I have solved my issues. Thank you.