Help needed to get my 7i76E + 7i85S + 7i73 on my mill going.

More
8 years 2 months ago #116011 by andypugh
First of all, does that component even compile?

Secondly, your net statements in the code above will also need to mention the component pins. (I am not 100% sure what they will be called, probably gearblocker.0.gear-A and similar.

(Unless you change the component name, and you might want to)

And you might want "change up" and "change down" outputs too. Or an output to display the suggested gear.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #116012 by tecno
Ahh, will give a try tomorrow to see if it compiles.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #116026 by tecno
Sorry No-Go

bengt@debian:~/linuxcnc$ halcompile gearblocker.comp
Traceback (most recent call last):
File "/usr/bin/halcompile", line 1353, in <module>
main()
File "/usr/bin/halcompile", line 1322, in main
process(f, mode, outfile)
File "/usr/bin/halcompile", line 1192, in process
a, b = parse(filename)
File "/usr/bin/halcompile", line 417, in parse
a, b = f.split("\n;;\n", 1)
ValueError: need more than 1 value to unpack
bengt@debian:~/linuxcnc$

Obviously I am doing something wrong but what?

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #116027 by andypugh

tecno wrote: Obviously I am doing something wrong but what?


Much more likely to be my fault. I typed that component on a Windows PC in my lunch break.

The problem is that halcompile is not finding the ;; separator.

Specifically, it is looking for \n;;\n (newline, two semi colons, newline)

There is a ;; in the file, but it turns out to be wrapped in Windows-style CR / LF sequences. I have fixed this. The attached file should work well enough to find the next problem.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #116028 by tecno
OK, I think it works.

1:st part with halcompile gearblokcer.comp no errors
2:nd part with halcompile --compile gearblocker.comp there is a list of errors See enclosed compile.txt

File Attachment:

File Name: compile.txt
File Size:1.65 KB

File Attachment:

File Name: gearblocker.c
File Size:7.64 KB


Is all OK or not?

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago - 8 years 2 months ago #116030 by andypugh
No, there are typos and errors in the file.

Firstly, I have copy-and-paste errors, the cases should be 1, 2, 4, 8, 16, default

"case else" is wrong. it should be "default:" I have been coding too much Visual Basic recently, and that is the VB equivalent.

Also, I have got some of the internal names of the pins mixed up (should be gear_min_speed() )

I also spotted an off-by-one error in the gear numbering (the HAL pins always start at zero, so we need to number gears from zero)
Last edit: 8 years 2 months ago by andypugh.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.564 seconds
Powered by Kunena Forum