Ethernet RS232 / 485

For general Flowcode discussion that does not belong in the other sections.
RGV250
Posts: 264
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Ah, it is making a lot more sense now, I had been thinking of where to set the RS232 settings, BAUD rate etc but the coverter does that once it gets the string from FC.
I will have to get one set up and configured, the Pi code the SQL database should be a good place to start.

Thanks,
Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi

Again I'm not 100% on this but you may also need the ModBus Master component, which may also need to connect to the Network Component, which will connect to the RPi TCP/IP component, which connects to the leg-bone, which connects..........

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
I wondered about that as well, first off I will try RS232 as I can use a terminal program and then loop the Tx/Rx to prove it all works before trying for Modbus.
Quite a lot to do first.

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi

Keep us posted.

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
I think I have hit a snag, I have opened the web manager and set the IP address of the device. The HTTP side uses port 80 (or whatever you set) so the NetworkComms connect component is OK but it also uses another local port (endpoint configuration) for the direction to the serial ports ***. The default for serial port 1 is 10001 and 10002 for serial port 2 so both serial ports are on the same IP address. I am not sure if this remote port will need a different component?
I am assuming it will also need this port for the receive component?

***
Page 33 https://cdn.lantronix.com/wp-content/up ... 100_UG.pdf

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi

I've not had a chance to download anything yet but I thought it provided two independent IP addresses, one for each TTL interface? Is it instead just one IP address but differing ports (e.g. 192.168.1.100:10001 / 192.168.1.100:10002 ) ?

If so then you can specify the address and port to connect to in the RPi TCP/IP or Network Comms component macros. To change "ports", disconnect, close socket then re-establish to next port.

Well, maybe........ I'm still under previous caveat :)

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
I may be reading it wrong and the port 80 is only if you want to look at the web manager and the serial ports use 10001 and 10002 so that would make sense and work like you have shown above. I will have to wait until I get the USB RS232 cable as all I have is TTL ones. Then I will be able to see, will probably use a terminal program first.

Bob

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
A long way off but potentially I will have 2 devices with 2 ports so would need 4 connections. I see above where you close the connection and then reconect which would probably be fine but I have a question for another solution.
On a lot of PLC equipment I used at work you could have a number of concurrent connections so the question I have is, can I have multiple TCP_IP_Pi - NetworkComms pairs. I quickly tried to draw this but it did not seem to allow me to connect the second pair but it did allow me to have 2 NetwokComms components connected to the same TCP_IP_Pi.

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi

I think the components allow four (0-3) channels to be used simultaneously. Not knowing frequency of polling I simply suggested closing. This would potentially give four concurrent connections.

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
I think I will possibly need both options as from what I can gather it will need another connection for the response so 2 devices with 2 ports would need 8 channels.
My idea (if it is possible) is to read both ports from one device and then switch to the other so i would enable 4 channels, read and then close them for use for the other device.
Anyway, all wishful thinking so far as I have to wait for the serial converter, I could have built one with USB/TTL and MAX232 but that seems a pain when they are so cheap. Could be a beer free weekend if it arrives on time.

Bob

Post Reply