Hello Guest it is May 07, 2024, 04:55:09 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 - simpson36

281
Mach4 General Discussion / Re: Mach 4 Feature Request
« on: May 19, 2014, 04:10:45 PM »
On compiling macros at startup: a bad macro should give an error message and not cause Mach hang forever. (don't ask me how I know about that ;-) ) 

If you are talking about Lua, there is a selection to compile in one of the drop downs in the editor. I have learned to always compile before leaving the editor to get that satisfying  'Compile successful' (or something to that effect).

282
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 16, 2014, 04:04:38 PM »
Tidbit:

D-Link DGE-530T NIC works with Win7 Pro 64bit and MACH4 TCP Modbus

I had one lying around, but I checked and it is still current and available.

Running Internet with built in NIC (Intel MB) set for Auto IP connected thru switch to CableONE router.

Hard coded IP on the D-link card for MACH4 TCP Modbus

Can run simultaneously. No conflicts.

FWIW 

283
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2014, 07:48:20 PM »
Brief Update and info.

Global functions calls are now working  :D

Combination of things, but get your notepads out because I have another rather esoteric  bit of support info.

Another  Win7 Pro 64 bit anomaly. Note that MACH3 did not complain about this nor the previously reported issue.

Naturally my main development computer is on internet and I am running TCP Modbus. I do not have two NIC cards in the beast (any more) , so to keep from switching back and forth, I configured TCP/IPv4 hard coded for two networks. I then entered the hard coded IP for internet into the CableONE router/modem.

That all works peachy . .  with one exception, for whatever reason, MACH4 *seems* to be looking for Modbus on the Internet IP. This *apparently * only happens during calls to global functions. I would not swear to that, but I did get a Lua error referring to not getting data from IP *********.********* blah blah which was the Internet IP.

*Perhaps* this is related to there being TWO instanced of Lua. One using the hard coded (configured) IP and the other using the first one it finds active?

I don't know for sure where the problem is internally in the OS or Lua, but removing the dual hard coded IPs resolved the problem.  

Prolly not going to be a common problem, but if you have Win7 Pro 64 bit tab in your support notebook, here's another entry for you.

BTW, I noticed the Modbus config window says Modbus Register . . .    ;D

I think that's a wrap, Guys. Time for a tall Whisky Sour, my friends. I shall toast to you all who provided guidance and patience.

284
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2014, 04:14:47 PM »
That's my point if you don't post your code, we are just guessing what your issue might be.

Generous offer, thanks. The code we are each using came from the same source; a post be a developer earlier in this thread. Save a few typos that have since been corrected, we are using, or at least starting with the same code. Of course our registers have different names, but that would not  cause the kind of systemic problems that are occurring on my machine.

Win7 Pro 64bit, firewall, all manner of resident drivers (Render Farm, Raid arrays, a ridiculously long list of NIC features, Various .NET extensions and who knows what MS adds with their suites). It is not important the MACH4 demo work perfectly on this creature under my desk and I don't want to waste anyone's time unless I have a fail on the CNC computer as well. Steve just dumped a ton of new (to me) info on how the modules interact and where to put stuff. That one post has cleared up a lot of the mystery for me, but it will take some time to dig thru it and test everything he mentioned. I understand about 85% of what he said, but I'll need to crack a book to get the rest of it.

If you say the global calls are working on your computer, that's good enough for me. Most likely it will work first try on the very basic CNC computer. If so, then I'll just grab a similar PC from around here or build a new one to work on MACH4 development. I have a huge investment in MACH, so one new computer is peanuts in the grand scheme. No problemo.






285
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2014, 03:17:48 PM »
I think I have mentioned it before, but it is worth mentioning it again.  There are two instances of LUA.

You may have mentioned it before, but this is the first I've read it . . . and it explains a LOT.  I don't have much time these days for general perusing of any forums, so if it was not in my tunnel vision (i.e. this thread) then I would have missed it.  What this is leading to is a big  :-* for taking the time to repost here.

Quote
Oh another thing...  DO NOT expect any scripts that Brian or I post to just work. 

My bad for not catching the case and spelling typos.  On the case sensitive issue, I know better, just missed it. On the spelling, I actually thought it might be a reserved word. Programmers do that stuff, sometimes just to be funny, sometimes with good reason. The basic public code I use to drive the Modbus is actually called Mudbus . . . to keep libraries from overwriting each other. Nobody is worse at typos than myself and I don't point them out just to bring attention to them. I was just asking if one of them was actually a keyword. 

In any case, FWIW, I am trying not to waste anyone's time on Modbus 101 or to post code for others to troubleshoot. I have no way to analyze (what I thought were) MACH4 error messages, so I post them in case there is some value to that. Otherwise, I am quite willing to do my homework and plug away until I am out of options.

Brian already put us on notice that modbus is not the focus for the demo release and speaking for myself, your time spent on this topic is greatly appreciated.  I am trying to be careful not to waste it and only ask MACH4 specific questions that only you can answer (until the docs catch up).  If I post a question that is not MACH4 specific, it will be out of ignorance of Lua, so please feel free to tell me to RTFM, because I do have them and I'm happy to do the homework.

286
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2014, 11:35:11 AM »
Ya Nvr No,

I just double checked and I have exactly the same lines in my Screen Load Script.

Overloaded,

Good eye for catching that. You posted the case sensitivity question earlier and of course you are dead right. I have already changed that so that all of the var names match exactly. C is generally case sensitive in all flavors that I have used, so typos and also the dreaded 'cut and paste' typos can be hell. MS C helps a lot with that by popping up the var names as you type. At first it is an annoyance, but you learn to embrace it before long.

If you look at the image on post #58 you will notice that the debugger blew up on line 2. After your post, I fixed the case issue and no joy. I went a step further and as you see on line 2, the var content is hard coded into the argument and it still blew up at the same place. That exact var is used in the now infamous M40 and it works fine, so it is not the argument causing the problem either. 

It is a mystery to me, but for now the 'Vaudeville solution' seems like the best course:

Patient: "Doctor, it hurts when I do this"
Doctor: "Then don't do that, NEXT!"

Badda BING!


Everybody,

I think it may be an issue with this computer. One of the images I posted (I think) showed Lua unhappy about something and calling out the IP of this computer.

There are a co0uple more things to try. One is to turn off the firewall and the other of course is to try the same procedure on my CNC computer (less complex and 32 bit). But the CNC computer is doing its job at the moment, so I can't mess with it.

It is good to know that it does work so the problem is on my end. I'm doing something stupid and obvious and just missing it completely -or- there is something in the OS of this computer that is blocking the calls.

As I mentioned, it's not something I plan to use right away  . .  if ever . .  so knowing it works is enough for now. I can play with MACH4 using self contained scripts for now. I'm posting the issue here as the final resolution, if any, might be valuable. For example, I discovered that MACH4 has to be 'run as administrator' (at least on this computer) or the OS blocks the IP traffic. So . . that would be a good thin g to add into the install instructions. Certainly can't hurt and it may save some hair pulling down the road.

Once again thanks for the responses!

287
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2014, 07:40:31 AM »
attempt to call global 'ReadReg'  (a nil value)

I don't get why you cannot call a 'global' anything, but I've run out of things to try, so I post here FWIW.

My schedule s slammed and I probably won't find much time to indulge my new MACH4 addiction, but I wanted to take time to leave some initial comments on the 'MACH4 experience' since I suspect that's what they are looking for.

GENERAL COMMENTS:

As far as the 'global call' issue; while it is typically easier to maintain an application that is composed of centralized functions, but I find that developing under a 'mothership' can dictate different priorities. From a support standpoint, sometimes it is better to have all of the code for a particular action self contained as that isolates a problem and prevents my stuff from going south if a user modifies the screen script and messes something up, or tries out a new slick feature that comes in the form of a new screen script which of course would not have all of my routines. It might also prevent a bug injected in a new release from thrashing everything. The bottom line of all that is that it's not particularly important for my purposes that the 'global' function calls work perfectly.  I probably will not use them unless they are contained in a separate file that would be immune to changes in the main screen script.

Certainly I do not know nearly enough about MACH4 to make a decision on that, but I think I have enough stuff working to evaluate the new methodology and perhaps come up with a plan for porting my stuff over. I have a bunch of new features to add also, but MACH3 is just too convoluted to be a good host for them. Lack if individually accessible registers prevented me from taking advantage of the much better Serial Plug-in structure. Broken Bit Wise operations, etc.

Kudos to the developers for making one structure for all of the Modbus interfaces in MACH4. The different setups for TCP vs Serial vs Serial plug-in are . . . .  a challenge. I've only scratched the surface thus far, but it appears to me that MACH4 is going to be a far superior platform to develop under than MACH3.

It has been challenging to get stuff to work. I purchased a LUA programming guide, but that doesn't help with the MACH specific stuff. When the MACH4 docs catch up, I expect it will not be such a chore to figure out how to do stuff. I know this demo was not released with the intent of users hacking away at the Modbus, so I appreciate the responses from everyone, particularly from the developers.

OVERALL IMPRESSION:

I think the developers are creating a support nightmare for everyone with the confusing Modbus terminology and a support nightmare for themselves with the packaging of the commercial/industrial version,  but neither of those directly effect me at this point, so my opinion, plus about six bucks, will get you a coffee drink at Starbucks.

Primarily, I build prototypes and therefor use the MDI a LOT so as I said previously, the Multi-Line MDI by itself easily justifies the $200 for MACH4 and I found that feature almost immediately. My focus here was to see what improvements had been made to the Modbus interface because that effects what can be developed on top of the new faster, mo' better core. The parts that I need to work, do work, and at first blush, it seems that the limitations have been moved from the software itself to the creativity and skill of the programmer, so that is a very good thing.


 


288
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 14, 2014, 04:28:23 PM »
Trying to call the new functions. Stepping thru the script and getting error message that indicates MACH4 is attempting to get the Registers off the computer's NIC address.

The script I am attempting to run and the added functions are shown below.  The IP in the error msg is the computer.

The script is attached to a screen button. I have tried it wrapped and unwrapped. 22 was substituted for the added vars to eliminate one possible cause.

289
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 14, 2014, 02:48:52 PM »
Code: [Select]
[quote author=smurph link=topic=27158.msg192373#msg192373 date=1400088487]
If the macro script is not wrapped in a function, then that is what you will get.

if (mc.mcInEditor() == 1) then
    m40()
end

My Macro was modeled after the existing M6 which does not have the editor detector at the bottom. I was blissfully unaware of the bit of the puzzle.

The macro was wrapped in a function, but would not run in the editor UNLESS it was unwrapped and stepped thru. Catch 22.

Now, with the 'In Editor' statements, I see that I can step thru AND it will also run.

I have your read and write functions added to the proper file (much thanks to Overloaded) but I am getting an error message when  I try to use them in a macro. Something about a chunk.

So, again thanks to all for the help. The macro is running now and I'll tinker about with calling the functions and see f I can get something going with that rout or by attaching the calls to a button . . . which I do not know how to do either . . LOL!!

Anyway, one step at a time, it is coming together. Thanks to everyone for their patience.



290
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 14, 2014, 01:15:26 PM »

if you change them to the correct modbus0 name, as you step thru the function you can see them pass the values


Thanks. I had a feeling it was just a typo. I though the term might be different on purpose to eliminate a conflict somewhere , but nothing is working for me either way, so I could not confirm.


Quote
far as a m40
you would have to put the script in a m40.mcs file
then call it as a mcode


Yes, it is an M40 macro. I tried it both source and compiled. It does work via the debugger, just really unpredictable from MIDI and never runs from G-code. Another mystery.

Incidentally, there is a compile choice on one of the drop downs in the editor, so you *,ight* not need to restart MACXH4 every time.

I did not know MACH4 compiled the macros at startup, but a glitch in that might explain why M40 runs every time MACH starts. That is really weird.

There is a possibility that these spooky problems have more to do with my Win7 Pro 64 bit machine than with MACH4. I will run this on my CNC computer which is less complicated and runs 32 bit Win 7 pro.


Thanks for the help.