- Posts: 29
- Thank you received: 1
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- SCADA/HMI Development
- PascalScada Modbus RTU with Moxa problem
Question PascalScada Modbus RTU with Moxa problem
- Marcin
- Topic Author
- Offline
- Junior Member
-
I have problem with modbus RTU. It's work fine through the hardware serial port or usb-ft232, but when I want to connect through the Moxa device in real com mode, it doesn't work correctly. I'm use Moxa De211 or Moxa 5110.
I can send data from HMIedit (label, tag), but i can't receive any data.
I'm working on the windows (XP, win7, 8.1) and CT 5.1.
Trying to change baudrate, stopbits etc. and nothing. Had Someone that problem?
Below few logs from serialport:
is-19 18:25:33.272, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 18:25:33.272, iocWriteRead, Result=iorTimeOut , Received: 00 00 00
lis-19 18:25:35.023, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 18:25:35.023, iocWriteRead, Result=iorTimeOut , Received: 00 00 00
lis-19 18:25:36.773, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 18:25:36.773, iocWriteRead, Result=iorTimeOut , Received: 00 00 00
lis-19 18:25:37.507, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 18:25:37.507, iocWriteRead, Result=iorOK , Received: 01 03 02
lis-19 18:25:37.507, iocRead , Result=iorOK , Received: 03 20 B9 6C
lis-19 18:25:38.304, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
I don't know If your Moxa can open TCP/IP port. If moxa supports it, you can use a TCP_UDPPort instead of TSerialPortDriver to connect directly on your moxa, avoiding settings on your operating system nor driver installation.
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
Yes, it's RS-232 and as I wrote earlier --> config is on Real Com Mode. Moxa supports the TCP_UDPPort, but the PLC i use have only RS-232 Modbus RTU interface (can't support Modbus TCP/IP protocol ). I don't thik that the problem is with the configuration or drivers. See the logs - send and recieve data. Also i tried Moxa with other scada and the configuration was the same. It was worked without any problems.


is-19 19:59:00.921, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 19:59:00.921, iocWriteRead, Result=iorOK , Received: 01 03 02
lis-19 19:59:00.922, iocRead , Result=iorOK , Received: 00 4D 78 71
lis-19 19:59:01.126, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 19:59:01.126, iocWriteRead, Result=iorOK , Received: 01 03 02
lis-19 19:59:01.127, iocRead , Result=iorOK , Received: 00 4D 78 71
lis-19 19:59:01.332, iocWriteRead, Result=iorNone , Written: 01 03 00 00 00 01 84 0A
lis-19 19:59:01.332, iocWriteRead, Result=iorOK , Received: 01 03 02
lis-19 19:59:01.333, iocRead , Result=iorOK , Received: 00 4D 78 71
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
I hope, that You will find the solutions of my problem.
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-

Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-

Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1

I tested it with a PLC, but now the PLC is installed on the cabinet far away from Me. PLC is connected to the PC with a RS-232. It's working, but there is a lot of errors communications, because of a long cable between PLC and PC(about 7 meters ). But you 're right, I also use the simulator, it's also not working. You can try it with mod_RSsim and Virtual serial port driver. Have the same effect without a moxa device. I tested PascalScada <--> program mod_RSsim - can send value from Hmi and can see the changes in Mod_RSsim, but can't see the changes on the HMI PascalScada when i try send the value from the simulator. Then I test the commercial Scada with mod_RSsim and I can see that: I can change the value on "Promotic" SCADA. When I tried to send some value in a simulator i can see the same value in "Promotic" SCADA. With PascalScada, when I'll send some value from simulator it' does't change on the HMI. Once again sorry for my English.
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
I attach the log file. Communication PascalScada - realcom moxa and simulator .
Attachments:
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
Attachments:
Please Log in or Create an account to join the conversation.
- avra
- Visitor
-
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
I have a conclusion that PascalSCADA tries to send the same thing both times, so it's not a problem with PascalSCADA.
But what is with this log:
lis-29 09:58:56.438, iocWriteRead, dResult=iorNone , dWritten: 01 06 00 00 00 2D 49 D7
lis-29 09:58:56.438, iocWriteRead, eResult=iorOK , eReceived: 01 06 00
lis-29 09:58:56.438, iocRead , aResult=iorOK , aReceived: 00 00 2D 49 D7
I undestand that: Pascal scada write 01 06 00 00 00 2D 49 D7 and simulator response 01 06 00 00 00 2D 49 D7 but PascalScada can't read this? - ( in simulator the value was change correctly but in the HMI value was changed to 0. In PascalScada LOGs You can read 01 06 00 00 00 2D 49 D7 without the result on HMI

Next:
lis-29 09:58:57.672, iocWriteRead, dResult=iorNone , dWritten: 01 03 00 00 00 01 84 0A
lis-29 09:58:57.672, iocWriteRead, eResult=iorOK , eReceived: 01 03 02
lis-29 09:58:57.672, iocRead , aResult=iorOK , aReceived: 00 2D 78 59
In the simulator program i change the value from 0 to 45, Pascal ask with 01 03 00 00 00 01 84 0A and response from simulator is 01 03 02 00 2D 78 59.
Why in logs PascalScada can read correctly from simulator but can't decode it and send to the HMI from tag1

I suspect cable problem, baudrate too high (try lowering speed if PLC allows), and no or wrong RS485 termination (if you use RS485 on PLC side).
Cable is 1m betwenn 2 PC , baudrate was changed to the lowest, I use RS-232 for test.
I also try rise the WriteReadDelay time and nothing

I don't know what I'm doing wrong

Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
I wrote a message through my smartphone, but it was not sent. Try a "stupid" idea: Put two HMIEdits linked with the same tag, and set, in both, FreezeOnFocus = false.
If this don't work, we have a big problem on another part of PascalSCADA.
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1

Do You already know the reason?
Please Log in or Create an account to join the conversation.
- Marcin
- Topic Author
- Offline
- Junior Member
-
- Posts: 29
- Thank you received: 1
EDIT:

(PascalScada <-->Moxa RealCom RS-232)< -cable->( RS-232 <-> Simulator) it's the same -not working

But if I do that:EDIT2:
(Simulator <->Moxa RealCom RS-232)< -cable->(RS-232 -<-->PascalScada)
it is working. I do'n understand that.
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
swicio1 wrote: Even now, if I'm deleted one of HMI it's working!.
Well, I'm not very good with property names. FreezeOnFocus don't explain to you what this property does on THMIEdit? Please tell me if yes or no, and if possible, suggest a new property name

Even if this property has a good name, I´ll explain what it does. If TRUE, when the HMIEdit receives the focus, it stops their update when the tag value changes. This was made for a more comfortable typing on it. If you set it to false, it only stops their update procedure if someone made some change on HMIEdit content.
Please Log in or Create an account to join the conversation.