MID instruction not working

hazemabdulrab

Member
Join Date
Feb 2014
Location
dearborn
Posts
46
Hello ,

I'm having an issue with this rung. I've tried with and without ONS and I can't seem to understand why it wont work.
and yes the routine is added as a JSR in the main routine.

Capture.jpg

any ideas?

Thank you
 
I would try a jumper around your NEQ to see if that's causing the issue. Not sure you can compare NEQ a string to null_string.
 
That all looks good - I'm just about out of ideas. Have you tried substituting another simple non-arrayed string as the source? Do you have a similar MID function working in another section of your program?
 
That all looks good - I'm just about out of ideas. Have you tried substituting another simple non-arrayed string as the source? Do you have a similar MID function working in another section of your program?


I think it has something to do with the length like u said. When i use the cps instruction to copy the length of the barcode to a dest. The source is a int and the dest is a dint. could that cause a problem?

what would be the best way to convert a int to a dint value?
 
I had a problem with a barcode reader in that, even though the strobe went TRUE the entire string was not in the result array yet. I waited until the length was something reasonable then copied. No problems after that.
 
Last edited:
That all looks good - I'm just about out of ideas. Have you tried substituting another simple non-arrayed string as the source? Do you have a similar MID function working in another section of your program?

It worked thank you. The problem was using the CPS instruction to copy the int length to a tag with a dint length. so i replaced it with a mov instruction instead of cps and it worked.

Thank you so much for the help. I really appreciate it.

Capture.jpg
Capture1.jpg
 

Similar Topics

So, I am a beginner-slightly intermediate level programmer, and I am looking for a way to access specific data, and pull it out of a larger...
Replies
11
Views
3,413
I am in the process of converting a PLC5/250 program and the program has a timer on delay (TON) instruction. The time base is set to SCAN. I have...
Replies
1
Views
2,336
Hi Folks, After many, many hours of setup/testing/tuning/etc I'm happy to announce our brand new shiny PLC forum is coming out of beta and...
Replies
30
Views
2,129
I have a LM9030 program that is running on a IC693CPU331 that was installed in the mid 90's. How can I find out if this cpu can handle newer VP...
Replies
3
Views
1,258
For nostalgic reasons does anyone know the model number for the DEC VMS computer that fits into the Pyramid Rack? I could only find the OS tapes...
Replies
1
Views
1,009
Back
Top Bottom