On Sat, 2009-05-02 at 09:57 +0000, Jayson Wallis wrote:
> Hi All,
> 
> I am currently at wits end and need some help from some people more
> knowledgeable than I.
> 
> For the past 2 weeks I have been trying to customize GS2_vfd.c (as
> well as modbus.c/.h) to work with my VFD which is a Huanyang
> HY02D223B. (The manual is on CNCzone
> http://www.cnczone.com/forums/attachment.php?attachmentid=79285&d=1239132143)
> 
> Since I have only ever programmed in basic and that is only PicMicros,
> I am finding this exceptionally difficult.  I have managed to fool
> (butcher) with it plenty and get an output that would probably work if
> I could only decipher how to read the input.  I am sure that I have
> gone about it all wrong and was wondering if anyone had a modified
> driver that was more suited to my requirements.
> 
> My VFD takes single requests and replies with single answers that is I
> can only read one thing at a time.  
> 
> To Read the programmed Frequency I need to send
> [01][04][03][00][00][00][F0][4E]
> 
> [01] Slave address [04] read control status [03] request length [00]
> read set Frequency [00 and 00] extra request padding [F0 4E] CRC
> 
> Generating the reply of
> [01][04][03][00][03][E8][F0][F0] corresponding to 10.00Hz
> 
> If I want to know the frequency out of the vfd  I send
> [01][04][03][01][00][00][A1][8E] 
> out amps is [01][04][03][02][00][00][51][8E] etc etc, until I have all
> the values required
> 
> 2 of the control requests are as follows
> sent [01][03][01][08][F1][8E] Drive Stop
> received [01][03][01][09][30][4E]
> 
> send [01][03][01][01][31][88] Drive run
> receive [01][03][01][00][F0][48]
> 
> and to set the run frequency of the drive I send
> [01][05][03][03][E8][00][73][8E] Set drive frequency 10.00 Hz
> receive [01][05][02][03][E8][B8][72]
> [01][05][03][13][88][00][5A][4B] set drive frequency 50.00 Hz
> receive [01][05][02][13][88][B5][9A]
> 
> I though that I could nut this out so that I didn't have to bother
> anyone but this is driving me crazy.  I tried to modify the classic
> ladder modbus routine also but had no luck with that either.  If
> someone has a stripped down version of the GS2 files that I may have
> better luck with I would greatly appreciate it.
> 
> Thanks,
> 
> Jayson.
> 
> (Horsham, Australia)
> 
I probably don't have a good answer, but I am a little unclear as to how
your program is not working. Are you able to send and receive Modbus
packets? Are the transactions above what you actually got in a buffer
somewhere? If not, I seem to recall that I chose a command that only
needed a valid send packet to get an indication on the remote end, which
was to turn on an LED on a ModIO:
http://www.homanndesigns.com/ModIO.html

The problems I had where in understanding the peculiarities of the
serial port and getting a handle on how CRC is implemented. I used a lot
of printf's in my program:
http://www.wallacecompany.com/machine_shop/EMC2/modbus/read_Din-1b.c 

to make sure that the program progressed as planned.

I found the Modbus specifications helpful:
http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf 
http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf 

( http://www.wallacecompany.com/machine_shop/EMC2/modbus/ )

I don't recall how far I got with this, but I seem to recall that I was
successful with turning on an LED and reading the status of a digital
input. I haven't gotten any further because I just don't have the time
and the programming skill.

If you can describe any results that turned out differently than
expected, it may shed light on the problem. Also, since you are familiar
with Basic you may be able to develop your program in Basic.
-- 
Kirk Wallace
http://www.wallacecompany.com/machine_shop/
http://www.wallacecompany.com/E45/index.html
California, USA


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to