CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > CamSoft Products


CamSoft Products Discuss Camsoft PC based CNC controller products here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 02-28-2006, 08:47 AM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road
Sleep Command

the sleep command within camsoft, is this only providing a "pause" for the current macro/mcode/etc that is running, or does it pause all execution of commands (such as watching the inputs changing state). the command listing in the manual does not seem to really have any explaination.

i ask this, because as i continue to get my tool changer to run correctly, the tool pot counting routine runs just fine, as long as i don't have the tool changer arm currently changing tools. As soon as i have the added I/O running for the changer arm, the counting routine seems to often "miss" pots as they go by the switch. I don't think this is within my inputio logic, as it all runs quite happily when there are not multiple processes trucking along.

thanks for the info!

-nate
Reply With Quote

  #2   Ban this user!
Old 02-28-2006, 10:19 AM
 
Join Date: Apr 2003
Location: United States
Posts: 279
camsoft is on a distinguished road

Good Morning Howling60

If you have two or more things at once happening it would be best to use the IF THEN GOTO commands rather than SLEEP because it will slow down other routines and have an affect on other timing sensitive logic as well as the WAITUNTIL command does also. Both with keep the system busy but the IF THEN commands together with GOTO in a tight loop will allow the processor to give up time in between to other logic more freely.

' Alternative to SLEEP
' This routine resets the time counter and waits for
' a certain number of milliseconds to elapse to continue
' 1000 ms equals 1 second
'
TIME RESETMS
:LOOP
TIME MS;\55
IF \55<1000 THEN GOTO :LOOP



' Alternative to WAITUNTIL
' Example routine thats waits for Input #16 to turn off
'
:LOOP
IF #16<>0 THEN GOTO :LOOP


Tech Support
CamSoft Corp.
951-674-8100
support@camsoftcorp.com
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #3   Ban this user!
Old 02-28-2006, 10:33 AM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

that's what i was afraid you were going to say.. well.. off to re-write all kindsa logic.. booo...

thanks
Reply With Quote

  #4   Ban this user!
Old 03-01-2006, 09:07 AM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

Originally Posted by camsoft

' Alternative to WAITUNTIL
' Example routine thats waits for Input #16 to turn off
'
:LOOP
IF #16<>0 THEN GOTO :LOOP

so, i have a possibly dumb question, but i believe i had this sort of logic in my code "way back when".. and found that using an MDI, if the m-code, or macro that was called, had any sort of a logic loop such as this, the control was essentially hung. the advice you gave me then was to use a waituntil command, which is what now causes problems, as other io cannot be reliably trapped. i'm very confused now...

i'm going to try the alternative for sleep, and see if that works out any better, as logic loops are still hanging the control.

will update as i make progress.

-nate

Last edited by howling60; 03-01-2006 at 09:33 AM.
Reply With Quote

  #5   Ban this user!
Old 03-01-2006, 09:42 AM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

so, i just put the "alternative sleep" into my routine, unfortunately, the logic loop within it does the exact same thing as any other logic loop for me, it hangs the MDI window and won't allow the routine to run.

I tried to capture this in a log file, but even the M6 call isn't captured in the log file, let alone the logic that is attempting to run.

I'm not trying to be mean, or start a flame war, but am asking an honest question.. does anyone else have a machine that is using a tool chain running independantly in the background, while the changer arm is off actually changing the tool? If so.. care to shed some light on how this was accomplished, as i am just about at my wits end. I suppose i *could* redo the routines, so that the tool chain will only operate while nothing else is happening.. but this is not really acceptable to me & those who will be running the machine.

thank you for any insight/light you can shed on these issues.
If my cbk file would be of any use, i can send it along if need be.

-nate
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-01-2006, 11:41 AM
 
Join Date: Apr 2003
Location: United States
Posts: 279
camsoft is on a distinguished road

Howling60,

It is hard to comment correctly without knowing more and seeing the files and also even speaking with you to ask questions.

It's very possible that some one could help you posting here and if you were merely curious we would understand your previous reason for posting here but since it now seems important we are offering to investigate. Yes, we would like your latest CBK, History, Job file, Last version installed and notes or some one to speak with to point out where to look. You're under maintenance so it doesn't cost anything for direct support. Having all the info and a live person on the phone makes our job easier and raised the quality of support.

To give you some insight for what we know at this point:

There's no reason why M6 shouldn't show up in the history file. There something else coming into play that's hanging or slowing the system down to a crawl.

The "IF THEN GOTO, SLEEP or WAITUNTIL" commands are designed to wait. To you waiting seems like hanging. However, that is what these are suppose to do to ensure proper program flow. If these commands appear in a M code or Macro within a G code program or are run from the MDI window it would make no difference. It should never hang the MDI screen, but it may be stuck in a loop essentially waiting forever for an event that doesn't happen so it appears to be hung. For example from MDI or a G code program you write custom logic in an M code or even call a macro from the M code, think of this as a extension of the G code program being ran. Much like a sub routine in a G code program that gets stuck in a repetitive loop and can't break free.


We do need to know the whole situation to comment correctly. While there are limits to the type of I/O (Galil, Ethernet or Auxiliary I/O), CPU index speed, Operating system and complexity of logic and logic commands used we would say ,Yes it should be possible to do both things at once. Is there someone doing the same thing you are? is hard to say. We don't keep those kinds of records and the others that work in this office can't think of any. We will let you know waht is possible once we know what we have to work with.

Tech Support
CamSoft Corp.
(951) 674-8100
support@camsoftcorp.com
www.cnccontrols.com
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #7   Ban this user!
Old 03-01-2006, 01:42 PM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

So, just to make sure i wasn't shooting off without basis, i just wrote an m-code to fire a solenoid, and wait until the corresponding switch was tripped. this movement physically takes about 1.5 seconds to complete.

code was as such

#68=1: #67=0 (fire the solenoid)
:WAIT
IF #52=0 THEN GOTO :WAIT
MESSAGE CHANGER MOVED
---M15

this works fine... when i stepped it up a notch, and put that code, into the macro [ARMSWING] (cut and paste)

i then had

[ARMSWING]
--- M15

when i used the mdi and called M15, the MDI window "hung" as i have taken to calling it. this event is not capturable in a logfile, as the mdi window never is able to complete the m-code (and subsequent macro) call.

I am going to go through and re-code this tool changer, using the if then goto loops, and not using macros, to see if this problem can't be simplified. i still do find it odd that a macro call with a loop internally will cause this to crop up though. If someone else would like to verify this on their control (and make sure it is/isn't just something i have going in the background, it would be much appreciated.)

-nate
Reply With Quote

  #8   Ban this user!
Old 03-01-2006, 01:50 PM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

Originally Posted by camsoft
,Yes it should be possible to do both things at once. Is there someone doing the same thing you are? is hard to say. We don't keep those kinds of records and the others that work in this office can't think of any. We will let you know waht is possible once we know what we have to work with.
regarding that, it was more of an open-ended question, directed at all the users/readers of this forum. Since there is such a broad user-base out there, i thought there might be someone that had attempted/completed a similar build, and might have some personal experiences/ideas/etc that might be applicable. I wasn't trying to imply that you guys would keep records on what your customers have applied your product to. There are so many different possible applications that the records just wouldn't be feasable to hold onto!

and now, off to try and uncomplicate things on this machine!

-nate
Reply With Quote

  #9   Ban this user!
Old 03-01-2006, 01:58 PM
 
Join Date: Apr 2003
Location: United States
Posts: 279
camsoft is on a distinguished road

Hello Howling60 ,

We don't want you to drive you self crazy and waste more of your time, so the short answer is that this logic running in an M code or Macro will hang a G code program or MDI for sure, until #52=0 is not zero.

We are saying the same thing you are. This is true.

The M code or Macro is an extension of the program running as a sub routine would be. The running program will execute up to the M15 then call the macro and wait. It will hold up the program until #52=1. The program will continue once #52 becomes 1.

Tech Support
CamSoft Corp.
(951) 674-8100
support@camsoftcorp.com
www.cnccontrols.com
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #10   Ban this user!
Old 03-01-2006, 02:23 PM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

Originally Posted by camsoft
Hello Howling60 ,

We don't want you to drive you self crazy and waste more of your time, so the short answer is that this logic running in an M code or Macro will hang a G code program or MDI for sure, until #52=0 is not zero.

We are saying the same thing you are. This is true.

The M code or Macro is an extension of the program running as a sub routine would be. The running program will execute up to the M15 then call the macro and wait. It will hold up the program until #52=1. The program will continue once #52 becomes 1.

Tech Support
CamSoft Corp.
(951) 674-8100
support@camsoftcorp.com
www.cnccontrols.com
this makes perfect sense to me (that everything would hang until #52=1)... what puzzles me is that the program seems to ignore the command to energize the outputs prior to dropping into the wait loop. If the solenoid were getting a signal, then input #52 would by default be forced into an on state, dropping out of the loop, as the cylinder would have physically run it over eventually.

i'll go play s'more... if nothing else, i'm becoming familiar enough with the control software that i'm almost seeing it in my sleep!

either way, i'm glad we're on the same page, thanks for the confirmations

-nate
Reply With Quote

Sponsored Links
  #11  
Old 03-01-2006, 03:48 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Nate, looking at your sample:
#68=1: #67=0 (fire the solenoid)
:WAIT
IF #52=0 THEN GOTO :WAIT
MESSAGE CHANGER MOVED
---M15

It is difficult to know if you have covered every contingency. Remember, computers are dumb!

What logic will happen if the switch 52 is made already? Not only do you have to plan for what you want to happen, but you may need to lay out a plan for the alternate branch of the results of the IF comparison.
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #12   Ban this user!
Old 03-01-2006, 03:56 PM
 
Join Date: Sep 2005
Location: usa
Posts: 67
howling60 is on a distinguished road

in this case, the test setup was incapable of having the switch (input #52) in a on state, as it was on the end of a 1.5 foot stroke for a hydraulic ram that is actuated by solenoids on outputs #68 and 67. in all my other logic, i have been covering the "what if it wakes up in X state" possibilities.

and computers ARE dumb.. i keep telling mine to go and make me a sandwich, cause i'm hungry.. it won't do it .. darn computers!



-nate
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 01:37 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361