Hello Guest it is May 27, 2019, 05:41:00 AM

Author Topic: CAUTION! User LED's Turn on with opening wizards  (Read 7979 times)

0 Members and 1 Guest are viewing this topic.

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
CAUTION! User LED's Turn on with opening wizards
« on: February 19, 2013, 02:15:12 PM »
Witnessed a very strange behaviour today - a potential cause for a disaster! It's on a lathe which does homing internally in the drives and sends back a command that it finished. To send a command to the drives to start homing we used User LED's in Mach which we turn on in the homing buttons and a simple Brain sends the LEDs state to the drives. LED ON -> Send command to drive -> Start Homing -> LED OFF.

Want happened today was the LED's going high when opening the wizards from the top menu, selecting threading wizard and clicking OK. As soon as OK is clicked, LED's go high and drives start homing. This is repeatable and happens each time exactly in the same way. How does it happen?! How is it that simple to UNINTENTIONALLY change the state of LED's?!

Dan
« Last Edit: February 19, 2013, 02:16:49 PM by Dan13 »

Offline Hood

*
  •  25,828 25,828
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #1 on: February 19, 2013, 05:23:19 PM »
What version of Mach?
Is it Simple Threading?
What LED number?
Hood
« Last Edit: February 19, 2013, 05:25:25 PM by Hood »

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #2 on: February 20, 2013, 02:42:15 AM »
Hi Hood,

Mach version .062.

Simple Threading Wizard. Normally, unless you installed additional ones, there are only two in the list - Simple Threadin and Turning. I probably should have checked the Turning one as well, but I didn't. I reckon it would be the same with that one as well.

LED numbers 1003 and 1005.

In the mean time we added a safety feature - a hardware button that goes directly to the PLC and the PLC would wait for both that button and signal from Mach to start homing. Don't think we would revert this and use merely the signal from Mach as we can't trust it anymore after seeing this happen. Who knows what else could then trigger those LED's. What if it would happen with a boring bar inside a part!

Very, very strange and scary!

Dan

Offline Hood

*
  •  25,828 25,828
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #3 on: February 20, 2013, 03:32:26 AM »
Ok I am getting that as well, as soon as I load any wizard the LED state must be changed,will have to look at it later to see if I can figiure pout why.
Curious why you are using a LED state to operate the homing? Can you not just call an output from VB and wait for an input instead of looking at  LED states?
Hood

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #4 on: February 20, 2013, 04:16:07 AM »
Using LED's for that since I don't know of another way. Talking to the PLC over Modbus with Plugin Enabled and as such it doesn't allow sending outputs from VB and reading inputs. Unless I am doing something wrong of course.

Dan

Offline Hood

*
  •  25,828 25,828
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #5 on: February 20, 2013, 04:26:44 AM »
Ah ok, that is one of the ptfalls of using the plugin.
I have asked a few people what the benefit of the plugin is and not had an answer, all I see is lacking of functionality with it but there has to be a benefit somewhere or why use it?
Hood

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #6 on: February 20, 2013, 04:54:27 AM »
Honestly, I don't know. Was just reading some posts by Scott (poppabear) where he strongly recommends using the plugin. Thought he must know something. Think without the plugin it's not stable or reliable...

What are the commands you're using in the VB? SetModOutput and GetInput? Also not sure how to work with the non plugin Modbus. Information seems to be lacking. Can you use Brains too with the non plugin version?

Dan

Offline Hood

*
  •  25,828 25,828
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #7 on: February 20, 2013, 05:07:49 AM »
I asked Scott what benefits there were to the plugin and dont think I got an answer.
As for not being stable then I would dispute that, have never had an issue with the non-plugin serial modbus in all the years I have used it,  it has been extremely stable and reliable.
Yes you can use it in Brains, can also use from VB and also use direct in Ports and Pins.
Yes VB is as you state.
 Heres a screenshot of my Modbus page.
Also CSMIO can use modbus for inputs and I was a bit worried it would be a problem seeing as I am using it for the PLC but on the one thing I have tested, encoder module input for height setter, it works fine.
Hood

Offline Dan13

*
  •  1,244 1,244
    • View Profile
    • DY Engineering
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #8 on: February 20, 2013, 05:42:17 AM »
This sounds good! Still not sure how to work with it. See the screenshot. How do you do the same in the non plugin version? Accessing numerous different addresses in the slave?

Is it a screenshot of your actual machine settings? You're using 8-1-N, while Scott strongly suggests 8-2-N.

Dan

Offline Hood

*
  •  25,828 25,828
  • Carnoustie, Scotland
    • View Profile
Re: CAUTION! User LED's Turn on with opening wizards
« Reply #9 on: February 20, 2013, 06:16:07 AM »
I am not sure if you meant to attach a screenshot or not but dont see one if you did?

That screenshot was from this desktop computer but below is the actual screenshot from the big lathe. And yes I am using 8-1-n not sure why but just what I have always had set and no issues.

You set the start register and then it will look from there, for example I have the first as 1025 (2001 Octal) and I have 4 registers set. I am also using the bitmapped (bitpacked?) option so the PLC has something like the following in it.
B2001.0
B2001.1
B2001.2
......
b2001.15
b2002.0
b2001.1
....
etc

So say for example I want to read b2001.1 from VB it would be GetInput(1) or B2002.0 would be GetInput(16)
Also I could set them up in ports and pins to an input, the ones above would be Port 0 pin 0 and Port0 Pin16

Outputs are the same idea
B4000.0 etc etc
 and setting  from VB would be
Set ModOutPut(0,1) or (0,0) depending on whether you are turning it on or off.
Likewise in Ports and pins you can set the outputs as port 0 pin 0 etc

Hood