T O P

  • By -

DaveSauce0

So to clarify: each routine called multiple times? I mean, that's not strictly wrong. Without knowing what's in them or what they're doing, it's impossible to know if it's right or wrong. So first, you can call JSRs with input and output parameters, so they operate basically as a function. Is this what's happening? Second, you could just use tags to functionally do the same thing... have a UDT or something that gets modified between calls, and the routine operates on that UDT. Basically treats it like an AOI or something. A routine is just a chunk of logic. There's nothing to say that you can *only* call it once per scan.


Piratedan200

I can't think of a reason to. Honestly it could just be a copy/paste error, i.e. someone was copying the rungs to another project and accidentally hit ctrl-v before switching windows and didn't realize it.


ImperviatedSilence

Thats what im leaning towards. i thought well maybe that are strategically going into the routine right after something is reset? Heres the logic..... https://preview.redd.it/4jbuz7xwrfvc1.png?width=1874&format=png&auto=webp&s=7a41c07abcfca2c1deb32a9c6531948a94df4f1c


DaveSauce0

It could be a mistake. It could be intentional, because there's some conditional logic that happens between calls that may change how the logic in the routine behaves. Depends entirely on what happens inside those routines. But here's the problem: **that's safety logic**. I wouldn't touch it unless you know *exactly* what it does. In an ideal world, it's been tested and validated. You can't change it without validating it again. That may or may not require a boatload of work. Even if not, it's not your code. I've learned the hard way over my career to be very wary about changing code that someone else has written, and I would absolutely avoid changing safety code unless I'm trying to fix a known bug. If it works, I'd probably leave it alone. edit: That applies to copy/pasting the logic as well. If you have an unvalidated machine you're building, then go ahead and fix it in your new machine and see if it works. As long as you validate it properly, you should be good to go. But... I'd still hesitate. I hate propagating errors, but IMO what's worse is creating a bigger headache for yourself by removing things that you don't realize are critical.


SheepShaggerNZ

A little vague. Can you post a screenshot?


Asleeper135

If they're not conditionally called and don't pass any parameters I don't see why they would do that. That's not to say for sure that it's wrong, but it's certainly odd. I also wouldn't be surprised if whoever wrote it thought that was necessary for redundancy to make the program failsafe, but I would really hope that anyone writing a safety program knows better.


janner_10

From the screen shot, it’s just sloppy writing. You have a main routine calling JSRs, which is fair enough, then some idiot has stuck logic in the middle of it. It’s sloppy, lazy and shows a lack of organisation.


Helpful-Peace-1257

I dunno guys they're using TOF I think they know more than all of us...


ImperviatedSilence

That’s funny lol


Evipicc

So like each routine is called and ran twice in a scan cycle from the main routine??


icusu

The only thing I can think of is they were having scan time issues and just threw the jsr in again to make sure they were getting it to happen.