I am trying to set up a Met One BAM 1020-9805 (touchscreen, ethernet port) with a CR850 datalogger. I have my datalogger connected to a NL201, which is then connected to an ethernet switch. I then have both the BAM 1020 and a modem connected to the same switch. I can remotely access the BAM through Met One's software. I am able to get to both the datalogger and modem remotely as well, my problem seems to be in the programming for the datalogger. Here's what I have for a very simple test program:
Public Result_
BAM
Public Socket_BAM
Public Shop_BAM(1)
BeginProg
Scan(5, Sec, 1, 0)
Socket_BAM = TCPOpen("10.10.10.42", 7500, 300, 20)
ModbusMaster(Result_BAM, Socket_BAM, 9600, 1, 4, Shop_BAM(1), 1, 1, 2, 200, 1)
NextScan
EndProg
Meanwhile, here's the relevant settings on the BAM:
RS-232: 9600 (baud rate)
Flow Control-232: NONE
RS-485: 115200 (baud rate)
Modbus Port: RS-232
Modbus Address: 1
Byte Order: 512
IP Config: Static, DHCP
IP Address: 10.10.10.42, 10.10.10.42:7500
Subnet Mask: 255.255.255.0, 255.255.255.0
Gateway: 10.10.10.1, 10.10.10.1
While the program is running and the BAM is plugged in, the Result_BAM variable counts up by one each cycle, which indicates there's a comms failure. The Result_BAM variable correctly shows a -11 value when the BAM is unplugged, so it's recognizing something when it's plugged in. If anyone has any insight, it would be much appreciated, I am new to networking.
Does Socket_BAM take on a value >100?
A IPTimeOut value of 20 is very short. I suggest changing to >100 (default is 7500)
The settings on the BAM seem to indicate Modbus over RS-485. It is unclear from this if the BAM is serving up Modbus over TCP/IP.