View previous topic :: View next topic |
Author |
Message |
horizonlight Guest
|
Modbus |
Posted: Sun Jul 22, 2007 7:53 pm |
|
|
Hi !
I looking the easy way to control a WAGO 750-315 Rs485 Modbus with pic 16f876 ?
I just nned to turn on and off output on it !
Thanks in advance
Alain Tanguay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 22, 2007 10:07 pm |
|
|
CCS has a modbus driver and 3 example files for modbus. Look in the
Drivers and Examples directories for the current CCS compiler.
(Don't ask me to post them. It's against the forum rules).
Also, Neutone has posted a modbus example in this forum's code library. |
|
|
umka
Joined: 28 Aug 2007 Posts: 99 Location: New Zealand
|
|
Posted: Wed Feb 27, 2008 7:14 pm |
|
|
what is the name of the example files coz i can find any. i can find the modbus driver. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 27, 2008 8:53 pm |
|
|
I find files by using a text search program such as Examine32.
When I tell it to search the compiler directory for all .c and .h files
containing the word 'modbus', I get this result:
Quote: |
c:\program files\picc\examples\ex_modbus_master.c
c:\program files\picc\examples\ex_modbus_slave.c
c:\program files\picc\examples\ex_modbus.c
c:\program files\picc\drivers\modbus.c
|
You can do the same thing by using the Windows "Find" program.
Go to Explorer and navigate to the compiler directory. Then press F3.
In the 'Find' window, enter *.c for the files to search, and then enter
"modbus" in the text to search box. It will find those files even quicker
than Examine32 will. |
|
|
umka
Joined: 28 Aug 2007 Posts: 99 Location: New Zealand
|
|
Posted: Wed Feb 27, 2008 9:14 pm |
|
|
i tried that and still can't find them. maybe i deleted them by mistake.
i have pcwh4 am i correct in guessing they did come with this compiler but on the ccs website under examples it doesnt list the modbus code |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 27, 2008 10:36 pm |
|
|
They're in vs. 4.068 and several versions before that.
If you don't have them, email CCS support and politely ask if
they'll send them to you. Give them your customer reference
number so they'll know you own the compiler. |
|
|
ljbeng
Joined: 10 Feb 2004 Posts: 205
|
|
Posted: Thu Feb 28, 2008 3:59 pm |
|
|
I just wrote a vb.net program to turn relays on/off on an AutomationDirect PLC. Modbus is fairly simple if you just want to be the master to 1 slave.
Code: |
send:
01 ID of slave
05 Write to Single Coil
AddHigh Address of coil
AddLow
ValHi Value to send
ValLow
CRCL CRC on all bytes
CRCH
|
|
|
|
|