GX developer: WAND command

If

  • SM400 is 1,
  • AND
  • the low eight bits of word SD212 are all zeros,
then

  • pulse M595
    • i.e. assign a value of 1 to M595 for one operation cycle* only (Vasily;)).

* one program scan plus other processing
 
Syntactically, yes, that is the explanation, but you need to look into the meaning of the special register or system register SD212, which holds the value of a clock.
SM400 is the "ALWAYS ON" system bit in the Melsec. So this rung is always executed. The instruction WAND H0FF SD212 D688 does a bit-by-bit AND of the constant 0xFF with the value of the SD212 storing it in register D688. If the Register D688 is zero the memory bit M565 is set to TRUE in one cycle or pulse as it is know in Melsec lingo.

It seems the purpose is to raise M565 to true when a timer is initialized. I could not find the English manual as I am at home. Hope the below screenshot heps.

2021-12-20SD212.png
 
It seems the purpose is to raise M565 to true when a timer is initialized.
Ah, so that rung generates a one-scan pulse in M595 at the top of every minute.

[Update: some Mitsubishi documents say SD212 is day-of-month; I assume that is for a different CPU or device, but the range of values will be 1 to 31, so it will never be 0 or a any multiple of 256, so I don't think it is that].

TL;DR

@AlfredoQuintero: ooh, thanks for the background.
yyy.png
From that image, it is not "when a timer initialized," but rather "When the seconds-of-minute is 00 (BCD*)."

So M595 would have a pulse on the first scan, for one scan, after the top of every** minute, i.e. when seconds-of-minute is 00 (BCD).

N.B. the H0FF in the WAND instruction could be H7F, or even H70, and that rung would work the same way, because the left nibble of the low 8 bits (tens digit of BCD of seconds-of-minute) of SD212 will never be greater than 5, and will change from non-zero to 0 once per minute at the top of every minute.

* See this link.
** assumes scans are always shorter than one second.
 
Last edited:
By the way, I am fairly certain that that Rung 2189 in post #1 of this thread could be replaced in GX Developer either by this rung:

SD212.6
----| |-----[PLF M595]---

or by this rung:

SD212.6
----|/|-----[PLS M595]---


with no change in functionality i.e. M595 would pulse a 1 for one scan on the first scan at or after the top of the minute.
 
I'm? Sorry?

Did it hurt (it does when I do ;))?

It's more like a cold shower during a cold winter morning.

By the way, I am fairly certain that that Rung 2189 in post #1 of this thread could be replaced in GX Developer either by this rung:


SD212.6

----| |-----[PLF M595]---


or by this rung:


SD212.6

----|/|-----[PLS M595]---
with no change in functionality i.e. M595 would pulse a 1 for one scan on the first scan at or after the top of the minute.
Really cool. Let's hope this is useful to Mas01.
 
There is another way, just use the DATERD function this populates seven registers with the date/time, the seconds are then stored in N+5
for example [DATERD D100] will put the following into D100-D106
D100 = Year (1980 - 2079)
D101 = Month (1-12)
D102 = Day (1-31)
D103 = Hour (0-23)
D104 = Minute (0-59)
D105 = Seconds (0-59)
D106 = Day of week (0-6)
So you compare any of the fields as integers no need to mask off.
 

Similar Topics

Hello, When I try to read from the PLC, the following error occurs: There is no project name. Failed to read the intelligent function module...
Replies
1
Views
47
I'm trying to verify a project with a PLC. The Transfer Setup menu item is grayed out and every time I click Verify with PLC, I get an error...
Replies
1
Views
89
Well, I've decided to start a new project, and like all projects, it has already gone horribly wrong. I purchased a PLC device (supposedly a...
Replies
2
Views
135
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
343
I'm trying to manually convert a Beijer E200 HMI project onto to a new Mitsubishi GOT gs2107-wtbd. The PLC is a very old A-series AS1CPU and is...
Replies
1
Views
405
Back
Top Bottom