Hello Guest it is April 27, 2024, 06:32:22 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - brianthechemist

Pages: « 1 2 3 4 5 6 7 »
31
Hi everyone,

I'm using the modbus plugin to talk to my VFD and I had it working last friday... I have been seeing some flaky behavior in the plugin, sometimes in the config screen it will not save my changes after I press "ok".  I'm wondering if there is a bug or something. (Version 4746)

Somehow now I get an incorrect value for a register read and this "195 - Unknown error" for the write. 

Both functions work perfectly well in the "CAS Modbus Scanner" that I have been using to troubleshoot.

Any thoughts?

32
Modbus / Re: More modbus "functions" or fewer (with multiple regs per)
« on: February 22, 2023, 06:04:50 PM »
I've got it mostly working now, there is one strange issue though.  The Setpoint value for the Spindle frequency keeps rapidly switching between my setpoint and 0.   

If I watch the frequency output register: "modbus0/freq" it appears to track.  It is almost as if there are two sources controlling the register: one that sets it to 0 and the PLC script setting it to the setpoint.

I have it setup like the folks did it over on this thread:  https://www.machsupport.com/forum/index.php?topic=34023.50

Code: [Select]
---------------------------------------------------------
--          set Target RPM DRO
---------------------------------------------------------
RPM=mc.mcCntlGetPoundVar(inst,2132);
mc.mcSpindleSetOverrideEnable(inst,1);
local OVRenable=mc.mcSpindleGetOverrideEnable(inst);
if OVRenable then;
    local OVR=mc.mcSpindleGetOverride(inst);
    RPM=RPM*OVR;
end;
local range=mc.mcSpindleGetCurrentRange(inst)
if RPM>mc.mcSpindleGetMaxRPM(inst,range) then RPM=mc.mcSpindleGetMaxRPM(inst,range) end;
if RPM<mc.mcSpindleGetMinRPM(inst,range) then RPM=mc.mcSpindleGetMinRPM(inst,range) end;
local freq=RPM/6;
local hfreq=mc.mcRegGetHandle(inst,"modbus0/freq");
mc.mcRegSetValue(hfreq,freq);
scr.SetProperty('dro(128)','Value',tostring(RPM));

I've still got to reorganize the "functions" to get rid of the overhead.

33
Modbus / More modbus "functions" or fewer (with multiple regs per)
« on: February 22, 2023, 01:16:30 PM »
Hi everyone,

I've got my modbus TCP working finally and I'm in the process of making a small tab with VFD readbacks (temp, current, voltage, etc).

I currently have 14 functions, all read except for one for spindle speed (run control is by terminals for safety and convenience).  Things are a bit slower than I would like (polling interval 250ms, wait 100)

I have 3 of my 14 functions timing out, (oddly, they are in the middle of the list).  Is it more efficient time-wise to group some of the functions together where possible and have one function read multiple registers? (some of the regs are next to each other).  I've attached the list for reference

Or is it really just the same timing no matter what?

I thought I read somewhere that mach goes down in the sequence, waiting the timeout time for each transfer.  If this is the case, fewer transfers would be better.  In practice, it may not make a difference. 

34
Is it possible to get your exact modbus registers and info? No need to redo all of your reverse-engineering just to set the spindle speed.

35
Perfect. I’ll have to play.

Do you think it will do what i need?

36
Ah good.  I was wanting to use it to test out the scripts and macros for my toolchanger without having the toolchanger present (for safety reasons).  Just hoping to see the DRO move and potentially some messages come through the log in response to inputs.

Is there a sample config that you can give me? (I’m using an older version .4764 or something), it looks like there has been alot of changes since then.

Thanks
Brian

37
Mach4 General Discussion / Any documentation on the "simulator" plugin?
« on: January 11, 2023, 08:02:05 PM »
I'm talking about the one that is built-in to the hobby version.

Does this create an off-line twin of a machine?  (nice for testing macros and scripts I guess)

Thanks
Brian

38
Mach4 General Discussion / Re: How to trigger "action" with an input?
« on: January 11, 2023, 07:45:50 PM »
Makes sense.

I'm partly using the buttons as an easy way to get to know the custom stuff, as I will need to implement the tool changer control and the remaining 2 axes (although I don't think there is much to do for the AC axes, I may find myself editing existing scripts to work with the additional axes.

I actually have another CNC that I already retrofitted with Mach4 (and all of the same electronics as for my 5 axis) as a test of my architecture and to make some parts for my scratchbuilt machine.  Luckily for me, I've actually had a great experience with it except for a few annoying buttons that I was hoping to implement with the console buttons here.

I'm a little confused about the states on the toggle buttons.  Do you know of a reference to read for me?  for example, how can a toggle be mapped to both an input and an output in the properties tab?  Is it an "and" or is it "or" between them?

Thanks!


39
Mach4 General Discussion / Re: How to trigger "action" with an input?
« on: January 11, 2023, 02:56:51 PM »
Haha, absolutely! I’ll admit that i have the mechanicals of my machine complete and have been procrastinating the sw config because of the learning curve. 

I’m just trying to learn the best practices for sure!

40
Mach4 General Discussion / Re: How to trigger "action" with an input?
« on: January 10, 2023, 12:00:03 PM »
Hi,

Quote
I found a workaround to use these actions by way of the scr commands.  They appear to work well but it feels kinda 'hackey' and not the right way.

Correct, I try to avoid scr commands. The correct way is to place an object, like a button, it does not have to be visible, but then you get the options of UpAction,
DownAction, UpScrpit, DownScript, ClikedScript etc.

Quote
Is there a convenient way to have an "include" file or something in the screen script that will pull from a separate lua file of my creation?

Yes you can write Lua modules or Lua Panels....I'm not really familiar with them Look up some of Daz-the-Gaz's videos.

Quote
I'm thinking to modify the actual screen script as little as possible and put my code in one script if at all possible.

Why?. I modify the screen load script, PLC script and others all the time. That's what they are for, and they work a treat. Take a copy of your preferred screen script,
wx4.set say, give it a unique name like Mywx4.set, and modify the hell out of it. When you update to the latest build the uniquely named .set file will survive the update
unaltered so you can carry on using it.

You are at the very least going to have to edit the SigLib table......so there is no avoiding editing the screen script. It does make sense to have all your edits gathered in one
place, so I'll often put all my own coded functions at the end of the script, but inevitably you will have to make a few edits throughout the screen script which can be a pain
to recall and trace. There is a function, if I recall correctly, which allows you to compare the differences between files and thereby locate any edits in one file compared to the
standard issue .set file.

Craig

Do you usually edit the xml file directly (within the .set file)?  I'm looking for something I can use in a different editor while looking at the current wx screen for reference.   I've got 'visual studio code' which I like because it is close enough to visual studio for me. 

Pages: « 1 2 3 4 5 6 7 »