
adccommunitymod (AutomationDirect) asked a question.
Created Date: January 26,2018
Created By: WWorld
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I am new to the world of PLCs. I have only played with one other PLC. Its programming was done with flow chart and had a sections for mapping of modbus addresses. So, it was easy to figure out the modbus addressing. I have't been able to locate any tutorials on third party HMIs to BRX yet, so if anyone knows of one can you point me towards it. With my other PLC Bits addressing started with 0x0 and Integers and Floating Points started with 4x0 and I could select which were writable.... I am only using this HMI as I already had it and I am looking to save some money if I don't have to spend it. It is hooked up to to the serial port not Ethernet if it make any difference. I believe from what I have been able to find the addressing is something like MC1 to MC1023, MI1 to MI1023, MIR1 to MIR2047, and MHR1 to MHR2047. I read somewhere, can't recall where, that I couldn't interact with the Inputs and Outputs directly as that would create some security issues. I am not sure if that was for Ethernet connections only. I am fairly sure if I place an on/off button on the PLC I would use MI1 and so on. What I am not sure on is it possible to display that state of x0 or y0 on the HMI. If so what address would I point the HMI to look at? Also is the PLC normally the Master or Slave when connecting a HMI? thanks
Created Date: January 26,2018
Created by: WWorld
I am new to the world of PLCs. I have only played with one other PLC. Its programming was done with flow chart and had a sections for mapping of modbus addresses. So, it was easy to figure out the modbus addressing. I have't been able to locate any tutorials on third party HMIs to BRX yet, so if anyone knows of one can you point me towards it. With my other PLC Bits addressing started with 0x0 and Integers and Floating Points started with 4x0 and I could select which were writable....
I am only using this HMI as I already had it and I am looking to save some money if I don't have to spend it. It is hooked up to to the serial port not Ethernet if it make any difference. I believe from what I have been able to find the addressing is something like MC1 to MC1023, MI1 to MI1023, MIR1 to MIR2047, and MHR1 to MHR2047. I read somewhere, can't recall where, that I couldn't interact with the Inputs and Outputs directly as that would create some security issues. I am not sure if that was for Ethernet connections only.
I am fairly sure if I place an on/off button on the PLC I would use MI1 and so on. What I am not sure on is it possible to display that state of x0 or y0 on the HMI. If so what address would I point the HMI to look at?
Also is the PLC normally the Master or Slave when connecting a HMI?
thanks
Created Date: January 26,2018
Created by: franji1
Basically, use COPY to move X0 into MI1 (since addressing starts at 1 for Modbus) and to move MC1 to Y0.
What may be best is to utilize $tTopOfScan System Task to block move your physical discrete inputs to MI block and in $tBottomOfScan to move your MC block into your physical discrete outputs.
Since addressing for Modbus doesn't matter, I would go ahead and start with MI200 and MC200 so you can move bits on BYTE boundaries that utilize similar address values (Modbus 10200 and 00200) and move those using BYTE CAST, specifically X0:UB to MI200:UB and then Y0:UB to MC200:UB. This will move 8 bits at a time as UNSIGNED BYTE, which is much faster (execution time) than doing 8 individual bits. The addressing is similar (X5 is MI205, Y3 is MC203).
$tTopOfScan:
COPY X0:UB to MI200:UB
$tBottomOfScan:
COPY MC200:UB to Y0:UB
So then your HMI just references Modbus Input 10200 for X0, 10201 for X1, ... 10207 for X7. Similarly, reference Modbus Coil 00200 for Y0, 00201 for Y1, ... 00207 for Y7. If you need more discrete I/O, just use the next group of 8 in your COPY instructions (MI208:UB with X8:UB and MC208:UB with Y8:UB).
If you need to use analog, use MI with WX analog inputs, and use MHR with WY analog outputs. Those doing need any byte aligning, but there is no Holding Register 40000 (MHR0), so you will need to offset the addresses by +1 (or maybe +10?).
Created Date: January 26,2018
Created by: BobO
I am only using this HMI as I already had it and I am looking to save some money if I don't have to spend it. It is hooked up to to the serial port not Ethernet if it make any difference. I believe from what I have been able to find the addressing is something like MC1 to MC1023, MI1 to MI1023, MIR1 to MIR2047, and MHR1 to MHR2047. I read somewhere, can't recall where, that I couldn't interact with the Inputs and Outputs directly as that would create some security issues. I am not sure if that was for Ethernet connections only.
Given that Modbus is completely unsecured, we felt that it was ill-advised to allow direct access to anything but a quarantined area, especially given the ubiquitous nature of Modbus support. The restriction is at the service level, not the port, so it does apply to all ports.
I am fairly sure if I place an on/off button on the PLC I would use MI1 and so on. What I am not sure on is it possible to display that state of x0 or y0 on the HMI. If so what address would I point the HMI to look at?
Use COPY to move I/O data into MI/MC where it is externally visible. It's brute force, but it's simple and controllable, and it's easy to disable if you decide to.
Also is the PLC normally the Master or Slave when connecting a HMI?
Almost universally the HMI is the master and the PLC is the slave.
Do-more's native protocol does allow access to I/O directly (since it can be secured) and there are a few 3rd party HMIs that support it, as well as full support in C-more.
Created Date: January 26,2018
Created by: Adisharr
Just to chime in, what BobO and franji1 suggest works very well and is extremely responsive. Also, nowhere will you find better support than here.
Created Date: January 31,2018
Created by: WWorld
Thanks for the fast responses.
I am getting a blinking RX light on the PLC but I don't get a TX Light. Is this due to requesting a bad address from my HMI so the PLC doesn't reply? I contacted the HMI support and they said the HMI should work with the BRX as it supports MODBUS RTU. But the Address scheme from the HMI uses 0x, 1x, 3x, and 4x. HMI support stated:
for holding coils, you'll use 0x (as the first number starts with that) the address is then 0 to 1023.
For Input Coils, you'll use 1x and address again is 0-1023,
holding registers are 3x addresses of 0-1023
Right now I don't have anything really programmed as I want to verify the HMI is working with the BRX. So, I just have a copy setup for X0 to MI200. And My HMI has a Bit lamp set to change based on the status of 1x200. But it appears the HMI can't read from 1x200. Do I need to use $tTopOfScan and $tBottomOfScan with a copy instruction?
Thanks
Created Date: January 31,2018
Created by: BobO
Thanks for the fast responses.
I am getting a blinking RX light on the PLC but I don't get a TX Light. Is this due to requesting a bad address from my HMI so the PLC doesn't reply? I contacted the HMI support and they said the HMI should work with the BRX as it supports MODBUS RTU. But the Address scheme from the HMI uses 0x, 1x, 3x, and 4x. HMI support stated:
for holding coils, you'll use 0x (as the first number starts with that) the address is then 0 to 1023.
For Input Coils, you'll use 1x and address again is 0-1023,
holding registers are 3x addresses of 0-1023
Right now I don't have anything really programmed as I want to verify the HMI is working with the BRX. So, I just have a copy setup for X0 to MI200. And My HMI has a Bit lamp set to change based on the status of 1x200. But it appears the HMI can't read from 1x200. Do I need to use $tTopOfScan and $tBottomOfScan with a copy instruction?
Thanks
There is a structure associated with each Modbus server. For the internal serial port it is IntSerialServer and there are some error fields there. That should give you some help as to why the comm fails.
I'm not sure I follow on the address discussion. Vendors frequently use 0/1/3/4 to indicate data type, which translates to a certain Modbus opcode. So 10001 translates into a Read Modbus Inputs for address 1, which for BRX will be stored at MI1...not MI10001.
Created Date: February 01,2018
Created by: WWorld
Thanks for the help
I ended up having the wrong unit ID set.
Created Date: February 05,2018
Created by: WWorld
$tTopOfScan question.
When I went to upload a test code it stated something about $tTopOfScan and $tBottomOfScan not enabled use ENTASK. But when I go and try to use ENTASK for $tTopOfScan it gives an error: System Tasks ($tTopOfScan) not supported in ENTASK. How do I correctly use TopOfScan and BottomOfScan?
Thanks
Created Date: February 05,2018
Created by: franji1
$tTopOfScan question.
When I went to upload a test code it stated something about $tTopOfScan and $tBottomOfScan not enabled use ENTASK. But when I go and try to use ENTASK for $tTopOfScan it gives an error: System Tasks ($tTopOfScan) not supported in ENTASK. How do I correctly use TopOfScan and BottomOfScan?
Thanks
Interesting. Are you using the Unused System Tasks, or did you try to create user tasks with the name TopOfScan and BottomOfScan?