ajiebon_88
Member
How to read all or few Data Memory from PLC and display in VB
I am new in PLC to VB programming and i have a basic in ladder diagram and VB. I have build a ladder diagram that set a value #1 to DM0 if any input(for example : 0.01) in on and value #0 if the input is off. I have a few input(for example : 0.01, 0.02, 0.03) that also did the same process that is MOV the #1 value to DM0(for input 0.01) , DM1(for input 0.02) and DM3(for input 0.03) when the inputs is on and MOV #0 value when the inputs is OFF. Now, i am asking how to read the DM0, DM1 and DM3 in PLC to display in VB. As i know, we can read only 1 DM in 1 command. The example comman in VB to read DM from PLC that i create is
RD = "@00RD0" & "000" & "0001" 'RD Command format
Q = 0
For I = 1 To Len(RD)
Q = Asc(Mid$(RD, I, 1)) Xor Q
Next I
AxMSComm1.Output = RR & Hex$(Q) & "*" & Chr(13)
What is the command to read all three DM above and display in 1 textbox, or 3 textbox seperate. Sorry my english language is bad. Hope anyone can help me coz i have find the solution long time ago. thanks:wish:
I am new in PLC to VB programming and i have a basic in ladder diagram and VB. I have build a ladder diagram that set a value #1 to DM0 if any input(for example : 0.01) in on and value #0 if the input is off. I have a few input(for example : 0.01, 0.02, 0.03) that also did the same process that is MOV the #1 value to DM0(for input 0.01) , DM1(for input 0.02) and DM3(for input 0.03) when the inputs is on and MOV #0 value when the inputs is OFF. Now, i am asking how to read the DM0, DM1 and DM3 in PLC to display in VB. As i know, we can read only 1 DM in 1 command. The example comman in VB to read DM from PLC that i create is
RD = "@00RD0" & "000" & "0001" 'RD Command format
Q = 0
For I = 1 To Len(RD)
Q = Asc(Mid$(RD, I, 1)) Xor Q
Next I
AxMSComm1.Output = RR & Hex$(Q) & "*" & Chr(13)
What is the command to read all three DM above and display in 1 textbox, or 3 textbox seperate. Sorry my english language is bad. Hope anyone can help me coz i have find the solution long time ago. thanks:wish: