Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of 2-ComfileHMI_Modbus by
main.cpp@2:f0fc57045b3d, 2016-09-09 (annotated)
- Committer:
- hyx2001
- Date:
- Fri Sep 09 04:07:37 2016 +0000
- Revision:
- 2:f0fc57045b3d
- Parent:
- 0:023c5cda6102
- Child:
- 3:f234e151b888
Comfile_HMI_Modbus
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
4180_1 | 0:023c5cda6102 | 1 | |
4180_1 | 0:023c5cda6102 | 2 | #include "mbed.h" |
hyx2001 | 2:f0fc57045b3d | 3 | #include "SimpleModbus.h" |
4180_1 | 0:023c5cda6102 | 4 | |
hyx2001 | 2:f0fc57045b3d | 5 | static u8 MDcoil[100]={0,0,0,}; |
hyx2001 | 2:f0fc57045b3d | 6 | static u16 MDregister[100]={100,200,300,400,}; |
4180_1 | 0:023c5cda6102 | 7 | |
4180_1 | 0:023c5cda6102 | 8 | int main() { |
hyx2001 | 2:f0fc57045b3d | 9 | StartModbus(PC_10, PC_11, 115200, 1, MDregister, MDcoil); |
4180_1 | 0:023c5cda6102 | 10 | |
4180_1 | 0:023c5cda6102 | 11 | while (1) { |
hyx2001 | 2:f0fc57045b3d | 12 | wait_ms(300); |
hyx2001 | 2:f0fc57045b3d | 13 | MDregister[0]++; |
hyx2001 | 2:f0fc57045b3d | 14 | MDregister[1]++; |
hyx2001 | 2:f0fc57045b3d | 15 | MDregister[2]++; |
hyx2001 | 2:f0fc57045b3d | 16 | MDregister[3]++; |
4180_1 | 0:023c5cda6102 | 17 | } |
4180_1 | 0:023c5cda6102 | 18 | } |
4180_1 | 0:023c5cda6102 | 19 |