Read CJ1M Data Memory and display in VB

F

Thread Starter

Faaizie

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 are 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 command in VB to read DM from PLC that I create is<pre>
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)</pre>
What is the command to read all three DM above and display in 1 text box, or 3 text box separate. I use Omron PLC (CM1J)

Sorry my english language is bad.

Hope anyone can help me coz i have find the solution long time ago. thanks

 
Top