Modbus Slave RTU with Machsupport CNC software

All About MODBUS ASCII, RTU...

Modbus Slave RTU with Machsupport CNC software

Postby max on Tue Jan 30, 2007 4:55 pm

Modbus Slave RTU works fine with Mach3 CNC Control application.

Check out their CNC software and drivers at:

http://machsupport.com/

To setup your Modbus on the CUBLOC Slave use this simple code for testing coils:

Code: Select all
Const Device = CB280

Opencom 1,115200,3,80,80
Set Modbus 1,1,20


Do
   _P(0)=1
   Delay 1000
   _P(0)=0
   Delay 1000
Loop



This code will simply turn Coil P0 On and Off every 1 second.

To read this in Mach3 software, you must first setup your Ports and Pins to Modbus and restart the software. Goto Config->Ports and Pins, then enter the base address of your COM ports and select the "Modbus Input/Output Support" then restart the program.

Now goto Config->Setup Modbus protocol and set the Port Number to whatever COM port you are using for Modbus and set baud rate to 115200.

You can test the sample code above by Clicking on the "Test ModBus" then
setting the Port Num and Baud Rate. Then Click on Open.

Set the Slave Addr to 1, Start to 0, Num Regs to 1 and select Coli(s).

Click on Read couple times and you should see the Debug Window switching from 0000 to 0001 to 0000 to 0001....

Here's some pics:
Attachments
mach2.gif
mach2.gif (20.41 KB) Viewed 4852 times
mach1.gif
mach1.gif (22.4 KB) Viewed 4851 times
User avatar
max
Site Admin
 
Posts: 1062
Joined: Wed Aug 31, 2005 9:21 am
Location: San Francisco

Return to MODBUS

Who is online

Users browsing this forum: No registered users and 0 guests

cron