Mitsubishi GX Works2 flakey M bit

pineapplc

Member
Join Date
Aug 2019
Location
Michigan
Posts
1
Has anyone ever witnessed an M bit randomly not turn on from a pulse instruction? Rung has only 1 condition to trigger this pulse instruction. Oddly the same M bit was working (ie. unlatching other bits) during that scan but would not change the counter on an INCR instruction. I ended up changing it to a spare M bit and it worked. Changed it back and it started working again. FYI- No other instructions are overwriting this bit, only the PULSE
 
It can happen when you put the PLS instruction or rising edge after the bits you want to actuate.
It's good practice to put all the bits after the one shot.
 
Also check you are not using the memory used by the compiler (these are reserved for temporary registers for the function block calls as there is no actual block when you create a function block, it moves all input values into the temp areas, jumps passed end of program to the function, does the logic and puts the output values into temp registers/bits, returns to main program and transfers them to the output memories

like this:

23 LD M8000 / Always on bit to call function
24 MOV D0 D855 / Move all values to temps
29 MOV K0 D854
34 MOV K1500 D853
39 MOV K0 D852
44 MOV K1500 D851
49 CALL P2066 / Call the function
52 MOV D850 D6 /On return, put the required result into register


Function (part of)

163 LD M8000
164 DEMUL D834 D840 D794
177 DEADD D794 D838 D792
190 INT D792 D850
195 SRET
 

Similar Topics

Not very often I ask for help, but this one has got me stumped. There are two ways to indirectly address memory areas in Mitsubishi PLC's. Using...
Replies
15
Views
4,498
New to GX Works2 (Structured Text), and encountered an interesting puzzle that the logical NOT didn't work as expected. Ex. NOT 0 turns out to be...
Replies
1
Views
1,742
Hi I am using a FX3u plc and as i want to create function blocks, I have to use labels. I have to use an array in my program, I want to use a...
Replies
13
Views
7,294
Hello, I'm trying to figure out what the Timer and Counter data types can be used for in Mitsubishi GX Works2. I can make Global Labels and...
Replies
3
Views
5,875
Hello Everyone, I am trying to learn the new mitsubishi software GX Works 2. I tried reading their manual but they dont explain really well the...
Replies
11
Views
7,325
Back
Top Bottom