Modbus Slave
Moderator: Benj
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Modbus Slave
Good Morning
The Componet Modbus Slave on the Flowcode 7, reseive data but no trasmite data (No responce).
Please. You could fix it and send?
Thank you very mutch
The Componet Modbus Slave on the Flowcode 7, reseive data but no trasmite data (No responce).
Please. You could fix it and send?
Thank you very mutch
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Hello,
Yes your right there was a problem with the ModBus Slave receive. The interrupt macro called when it receives a byte was not being implemented correctly.
I have now fixed the component and also here is an example that I have up and running on hardware.
Here are the example files.
Yes your right there was a problem with the ModBus Slave receive. The interrupt macro called when it receives a byte was not being implemented correctly.
I have now fixed the component and also here is an example that I have up and running on hardware.
Here are the example files.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Good Morning
Thank you very much for reply.
The macro ReadCoilState working Perfect. no errors and very fast.
Please. You want to fix macro SetAnalogeInput.
Thank and best regards
Thank you very much for reply.
The macro ReadCoilState working Perfect. no errors and very fast.
Please. You want to fix macro SetAnalogeInput.
Thank and best regards
Re: Modbus Slave
Do you mean SetAnalogInput not working?Konstantiant wrote:Good Morning
Thank you very much for reply.
The macro ReadCoilState working Perfect. no errors and very fast.
Please. You want to fix macro SetAnalogeInput.
Thank and best regards
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Hello
Yes, they have all Macro behavior of macro ReadcoilState. And it shown when positions the cursor to the address showing your coilAddress, while you you select a setAnalogInput.
I believe that the Matrix team will soon complete the componets Modbus slave. Thanks
Yes, they have all Macro behavior of macro ReadcoilState. And it shown when positions the cursor to the address showing your coilAddress, while you you select a setAnalogInput.
I believe that the Matrix team will soon complete the componets Modbus slave. Thanks
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Investigating this now....
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Found the problem now, all seems to be working well again with the updated components attached. As usual just drop these into your "Flowcode 7/Components" directory before starting/restarting Flowcode.
I also found a problem where the UART timeout on 8-bit PIC was taking far too long so here is the fix for that. This file lives in the "Flowcode 7/CAL/PIC" directory.
Lastly here is another example using the ReadInputRegister command which is now working nicely here on my desk.
I also found a problem where the UART timeout on 8-bit PIC was taking far too long so here is the fix for that. This file lives in the "Flowcode 7/CAL/PIC" directory.
Lastly here is another example using the ReadInputRegister command which is now working nicely here on my desk.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Hello
The Modbus Master component working well, but the macro ReadInputRegister,for RegAddress value >3 not responding.
The modbus Slave component working with Device ATMega2560 but no with Device ATXMega32A4.
Please you can check the AVR_CAL_UART.C ?
Thank you very mach
The Modbus Master component working well, but the macro ReadInputRegister,for RegAddress value >3 not responding.
The modbus Slave component working with Device ATMega2560 but no with Device ATXMega32A4.
Please you can check the AVR_CAL_UART.C ?
Thank you very mach
- Attachments
-
- Slave_SetAnalogInputATxMega32A4_FCV_7.fcfx
- (11.14 KiB) Downloaded 469 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Hello,
I've just tested the Modbus Master and Slave with a ReadInputRegister(28, 0, 6) and this is working well on the PIC target.
It initially wasn't working but I had forgotten to connect the grounds of the two uCs together. School boy error
With the ATXMEGA device. Have you done a 1 second flasher test to confirm the chip is running at the correct speed.
http://www.matrixtsl.com/wikiv7/index.p ... ED_flasher
Another thing you can try is to add a RS232 component, call the initialise macro and then inside a while 1 loop send out the value 0xAA. This should give you a waveform which you can check out with a scope or signal analyser to double check the baud is being calculated correctly. Both the mark and space wave cycles should be around about 104.166uS with a baud of 9600.
I don't currently have an XMEGA device to hand but I can get hold of some if this is proving to have issues.
Personally I wanted to love the XMEGA devices when they came out but then I tried to use one and quickly went off them. They have some nice features but for me are very peculiar and awkward, the EP range of dsPICs I feel is far superior.
I've just tested the Modbus Master and Slave with a ReadInputRegister(28, 0, 6) and this is working well on the PIC target.
It initially wasn't working but I had forgotten to connect the grounds of the two uCs together. School boy error
With the ATXMEGA device. Have you done a 1 second flasher test to confirm the chip is running at the correct speed.
http://www.matrixtsl.com/wikiv7/index.p ... ED_flasher
Another thing you can try is to add a RS232 component, call the initialise macro and then inside a while 1 loop send out the value 0xAA. This should give you a waveform which you can check out with a scope or signal analyser to double check the baud is being calculated correctly. Both the mark and space wave cycles should be around about 104.166uS with a baud of 9600.
I don't currently have an XMEGA device to hand but I can get hold of some if this is proving to have issues.
Personally I wanted to love the XMEGA devices when they came out but then I tried to use one and quickly went off them. They have some nice features but for me are very peculiar and awkward, the EP range of dsPICs I feel is far superior.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Hello
I've just tested the Modbus Master with forceSingleCoil on the ATXMega32A4 target, with Flowcode 6 and Flowcode 7.
The clock on the MCU is correct. The Led Flashing per sec.
The attach file Test-ModbusMaster-ForceSingleCoil-V6 working well
When opening with Flowcode 7, stopping on the macro ModbusMaster,ForceSingleCoil, and the led is permanent on.
Please, compare the code C from the FC6, with code C from the FC7
Thank you very mach
I've just tested the Modbus Master with forceSingleCoil on the ATXMega32A4 target, with Flowcode 6 and Flowcode 7.
The clock on the MCU is correct. The Led Flashing per sec.
The attach file Test-ModbusMaster-ForceSingleCoil-V6 working well
When opening with Flowcode 7, stopping on the macro ModbusMaster,ForceSingleCoil, and the led is permanent on.
Please, compare the code C from the FC6, with code C from the FC7
Thank you very mach
- Attachments
-
- Test-ModbusMaster-ForceSingleCoil-V6.fcfx
- (47.69 KiB) Downloaded 371 times
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Hmm,
There are differences in both the AVR CAL UART and the Component C code from v6 to v7, however there is nothing show stopping jumping out at me. Mostly minor reliability improvements.
I'll keep looking...
To confirm if it's a CAL problem you should be able to take the v6 UART CAL file from "Flowcode 6/CAL/AVR" and copy into the same folder in v7. Make a backup of the v7 file first so you can go back. Then just re-compile your v7 project.
Let me know how you get on with this.
There are differences in both the AVR CAL UART and the Component C code from v6 to v7, however there is nothing show stopping jumping out at me. Mostly minor reliability improvements.
I'll keep looking...
To confirm if it's a CAL problem you should be able to take the v6 UART CAL file from "Flowcode 6/CAL/AVR" and copy into the same folder in v7. Make a backup of the v7 file first so you can go back. Then just re-compile your v7 project.
Let me know how you get on with this.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Hello
The replace V6 AVR_UART CAL has no change.
Because I observe that at the start MCU, sends only one time data properly, and stops, I personally think that run within in a continuous loop, on macro ModbusMasterForceSingleCoil.
Thank you very mach
The replace V6 AVR_UART CAL has no change.
Because I observe that at the start MCU, sends only one time data properly, and stops, I personally think that run within in a continuous loop, on macro ModbusMasterForceSingleCoil.
Thank you very mach
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Hello,
Hmm right one thing I did notice is that Flowcontrol is enabled in the CAL UART component inside the Modbus Master component.
I have now forced this setting to be in the off state so hopefully this should work better.
Let me know how you get on.
Hmm right one thing I did notice is that Flowcontrol is enabled in the CAL UART component inside the Modbus Master component.
I have now forced this setting to be in the off state so hopefully this should work better.
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Hello
Thank you very much.
The Component Modbus Master working very well and on the ATMEGA32 Device.
Please, you can fix and the component Modbus Slave (CAL UART inside)
Best regards
Thank you very much.
The Component Modbus Master working very well and on the ATMEGA32 Device.
Please, you can fix and the component Modbus Slave (CAL UART inside)
Best regards
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Modbus Slave
Hello,
Here is the ModBus Slave component with the same fix, though hopefully this should not be an issue with the slave.
Here is the ModBus Slave component with the same fix, though hopefully this should not be an issue with the slave.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Sun May 09, 2010 7:57 pm
- Has thanked: 3 times
- Been thanked: 4 times
Re: Modbus Slave
Hello
The component Modbus Slave, now run normaly on the flow chart,
but the macro CheckForIncoming, have return value [0], and the MCU ATMega32A4U not responds.
Please check the Macro CheckForInkoming.
Thank you very mach
The component Modbus Slave, now run normaly on the flow chart,
but the macro CheckForIncoming, have return value [0], and the MCU ATMega32A4U not responds.
Please check the Macro CheckForInkoming.
Thank you very mach