
adccommunitymod (AutomationDirect) asked a question.
Created Date: March 09,2016
Created By: Program
**** 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.****
Hello, Don't know how familiar people are with Mach3 around here but I am stuck, and in need of some help. I have been attempting to control my Durapulse GS3 drive through mach3 using modbus. I'm using automation directs usb-rs485 cable. When I go test my modbus connection in mach3 I'm able to open the port successfully and read the hex values when I have the radio button for the "holding registers " selected. When I select a different radio button, for example the "input registers " and attempt to read the hex values I receive a status message of "invalid function " in mach3. The drive will also display an error of "invalid command code ". I'm quite new to using modbus and have no idea what these errors may be hinting at Any help would be appreciated. Thanks
Created Date: March 09,2016
Created by: bcarlton
It seems that the available information is all in 'holding registers '. The error is merely saying 'I don't have and Input Registers to give you.
So just communicate with holding registers. (A hint in the GS3 manual is that the available registers start with '4 '.)
Created Date: March 09,2016
Created by: Ridgeline Mach
One thing that could be helpful to you is to read pages 5-9 and 5-11 or your drive's manual. There you will see a table with a column of the Modbus addresses. It may be quite possible you 're attempting to read or write to addresses that are out of range.
Created Date: March 10,2016
Created by: Program
Thanks for the replies. I found some of the information helpful. After doing some more testing this is what I have found. Hopefully there is enough information for someone to help.
I have set all my devices to use 8bits, Odd, 1 stop bit.
The attached images show my various settings.
The scripts I'm using are as follows. I downloaded these from another post and am not familiar with the nomenclature to identify any problems.
M3
call setmodoutput (0,1)
call setmodoutput (1,1)
call setmodoutput (64,600)
DoSpinCW()
M4
call setmodoutput (0,1)
call setmodoutput (1,0)
call setmodoutput (64,600)
DoSpinCCW()
M5
call setmodoutput (0,0)
call setmodoutput (2,1)
DoSpinStop()
Spindle Speed
rpm = GetRPM()
SetSpinSpeed( rpm )
The following link shows the modbus addresses for the VFD starting at 9.26 (page 5-9 lower right corner)
https://www.automationdirect.com/static/manuals/gs3m/ch5.pdf
If someone can explain to me why I have found a need to drop the first 4 when I enter the address into Mach3 I would appreciate it. When I enter the address as listed I get an "illegal data address " status message.
I also saw another post setting up a GS2 drive where they had also dropped the 4.
http://www.machsupport.com/forum/index.php/topic,27376.0.html
The above has a starting register of 2330 and 2331 I have mine set to 2331 and 2332.
What I have observed. With Starting Registers 2331 and 2332
VFD display on startup: Stop, 0 RPM, Forward
In MDI I enter an M4 command and observe that the vfd displays: 0 RPM, Stop, Reverse
M5: Stop, 0 RPM, Forward
M3: External Fault , Reverse, Stop -----the external fault address is 42334, the next address after direction address
When I enter M5: Stop, Forward, External Fault message
If I enter an s command there is no change.
Now if I change my starting addresses to 2330 and 2331 the following is displayed
M4: Run, Forward, 1765 RPM (this is rpm at 60hz) ---Direction has changed, It's running vs stopped, and RPM is not 0
M5: Stop, Forward, 0 RPM
M3: Run, Reverse, 17 RPM
M4: Run, Forward, 17 RPM
The RPM for M4 will remain 1765 until an M3 command is given then both will be 17 following that command. I have no idea why.
If I give an s command, s600 m4, the vfd displays a message of invalid data.
I hope there is enough information available for people to provide me with some insight into what is going on. And what I can do to fix it.
Thanks
Created Date: March 10,2016
Created by: bcarlton
Modbus references:
The 'first 4 ' is just a memory area identifier for the region called 'holding registers '. These typically are word length registers (not bits) that aren't directly from its own analog input.
In the first Modbus capable (Modicon) PLCs this may very well have had a numeric reference for the address. But now they may as well be a heart, club, diamond and spade as it really isn't a 'number '.
Just read the '4 ' as 'Holding Register ' then the rest of the number. When you create a Modbus request the type of the request implies the same thing as that initial number - so stating it isn't necessary.
But unfortunately it will continue to be confusing.
Created Date: March 11,2016
Created by: kewakl
Just curious, is there an overwhelming reason to have a Mach3 kernel at 65KHz?
I run mine at 35KHz because Z was too slow at 25KHz - using any profile.
Created Date: March 11,2016
Created by: kewakl
What is the 'fd ' in the M3 macro? third setmodoutput() instruction. typo?
What do you mean by an 's ' command? Where do you enter the 's ' command?
Created Date: March 11,2016
Created by: Program
No reason for the 65KHz, other then I was testing the machine and wanted to increase my feedrate and needed to increase this due to encoder count.
Currently the VFD is the only thing I have connected to mach3. I'm not powering my controller or any of the servos. I just wanted to test the VFD.
The 'fd ' is an error when I was editing my post and re writing a section, I didn't notice it when I went to post it. It is not in the script.
The 's ' command is the spindle command I enter in mach3 in the MDI section.
For example I entered 's1000 m3 ' hoping to see an output on my VFD of : run, forward, 1000rpm.
Created Date: March 11,2016
Created by: kewakl
The 's ' command is the spindle command I enter in mach3 in the MDI section.
For example I entered 's1000 m3 ' hoping to see an output on my VFD of : run, forward, 1000rpm.
Is 's1000 m3 ' a valid sequence?
I seem to remember that for a called macro to USE a value, you have to pass that value to the param and the macro would have to apply the param.
I don't know about setting a system param such as 's '
And as a note from the Macro programming guide for Mach 3.x
complete with typo's
SpindleSpeed Should modify Spindle Speed, but does not work in all versions. User
SetSpinSpeed() instead.
Created Date: March 12,2016
Created by: Program
I have managed to sort out my situation. Thanks for all the help. In case anyone is interested in the solution I have made a post on another forum.
http://www.cnczone.com/forums/spindles-vfd/301902-help-setting-gs3-vfd-mach3-controlling-via.html#post1850728
Created Date: March 12,2016
Created by: kewakl
Glad you got it sorted out for your application.
I'll look at your cnczone post when I'm at my pc.
Thanks for sharing your resolution.