How to do if two words are not equal, then copy in directsoft?

zmarcoz

Member
Join Date
Jun 2011
Location
US
Posts
10
Dear all,

I am new to PLC. I have a HMI which constantly sending two words (desired stage) to a PLC location 'VA' (memory - NOT controlled by me). Somehow 'VA' will also change 'CA' (contact - can be temporary controlled for one scan). Since 'VA and CA' are controlled by HMI, I planned to create another two words 'B'. 'B' is the real words of my machine internal process state. 'B' will also be updated after machine does something.

I need to write the following to handle HMI issue
If VA!=CA, then B=VA. Otherwise B is unchanged.

What command I can use to do that in directsoft32?

Thanks
 
Last edited:
Your question is unclear. You speak of words sent from the HMI. Then you describe 'CA' as a contact. Is it a contact or a word?

Generally an HMI will not CONTINUOUSLY send a value. Usually it onlys ends it once at the time of entry by the operator. Could that be causing any confusion?

You mention creating 2 words 'B'. One name for two words?

Can you please restate your question using actual V memory register addresses (or C addresses if you are using a contact)? It would be much clearer and we can give you an example.
 
Thanks for your reply. I am sorry that I did not write well.

"Somehow 'VA' (memory register addresses) will also change 'CA' (contact - can be temporary controlled for one scan)"

Actually, a previous PLC guy wrote something that I do not well understand. 'VA' is a 2 bytes word, 'CA' is 16 bit binary number that represent the state. Since in the PLC program will read VA and then CA would update like

Read
VC200 ('reading signal from HMI', this have 16 bit, memory register addresses)
Then
if "C205" is on , do something (the internal value C205 will be changed)

What I want is to stop PLC keep reading from the memory register VC200 and keep writing on C205

THanks again
 
It's still not very clear to me what you want. 'Do Something' is not very specific. Possibly you can post the current program? Otherwise I don't think I can help.

If you don't thouroghly understand the current program then you probably shouldn't change it.
 
It's still not very clear to me what you want. 'Do Something' is not very specific. Possibly you can post the current program? Otherwise I don't think I can help.

If you don't thouroghly understand the current program then you probably shouldn't change it.

What I mean of "do something" is run a blower and a heater.

I have to do that because my boss asks

May I know what is the different between "memory register addresses" and "memory"? The program have code keep reading from VC200, but it will update the value C200. If I reset VC200, does it mean I also reset C200?? Thanks
 
Last edited:
Resetting VC200 is the same as individually resetting C200 through C217 (16 addresses, octal adressing).

Will you be able to post the code to at least provide some reference? You would zip together all the files (with the same base name) in the directory which contains the program then post the 'zip' file.
 
Here is the problem
I have tried to make an update only FKEY VC320 change, but I cannot make it

Capture.jpg
 
I still do not understand what you want to do, but thank you for the rung of code.

Please forgive me if I am presuming too much but if English is not your primary language please post again in your primary language and maybe someone can provide a translation closer to what you want.
 
That is all code to take data from an HMI and copy it into the PLC memory along with turning some LED's on the HMI on and off. It is a bit difficult to determine if it is a Cmore Micro HMI or an Optimate HMI from the code.

I really don't think that this is where the change needs to occur at.

We would need to see the entire program to make a better suggestion in order to help you out.
 

Similar Topics

Hi I am being given several fault words (as a DINT) from a Drive that I am receiving into a Compactlogix L33ER controller. I have a small...
Replies
12
Views
1,159
So I need to be able to give 10 people passwords to the machine and I need to make a log of when they are used. It's a Rockwell l71 processor and...
Replies
3
Views
905
The topic of reading or writing floating-point values via Modbus seems to come up regularly, and it is to my mind not that difficult. That said...
Replies
0
Views
1,409
I have a customer that has a GT1575-VNBA and I think they are using GT Designer. They have the software and program for both the HMI and the PLC...
Replies
3
Views
2,359
Hello, I am using Machine expert - basic with an M221 PLC. I have two 16 bit modbus registers coming in and I want to convert to a 32bit real...
Replies
8
Views
3,984
Back
Top Bottom