AB DF1 and VB

O

Thread Starter

Offer Dahan

Hi all
I would like to get Information from AB SLC500/Micrologix with VB & MSCOMM.OCX
Is there anyone out there that did it before??
Is there any running code that I can get???
I need some support with that...
I'm good with VB, I'm good with AB products but have no Idea about com protocols.. this is my first try.
Thanks in advance Offer Dahan
 
well, u can download the protocol details from the Allen Bradley's site. U can carry the detail study of DF1 protocols and write ur code accordingly in VB. So i hope that will be helpful to u. however this is bit difficult.
The easiest solution of ur problem is to use the DDE interface facility. For that u have to use RSLinx professional which supports the DDE interface facility. its really easy to fetch the data of PLC through DDE link using RSLinx professional.
If u need some more info then i can supply the same, i hope u will be abel to find the best solution of ur problem
 
Thanks, I know I can use DDE and I do it a lot.
But I would like to write a DF1 protocol more for the knowledge than for using it...
Thanks again
Offer
 
Thanks, I know I can use DDE and I do it a lot.
But I would like to write a DF1 protocol more for the knowledge than for using it...
Thanks again
Offer
 
K

Kevin MacMillan

Oct 16, 2001 was a while ago.

No problem.

Just how much do you want. Bit, Word, Float, ect.

I have some mscomm32.ocx samples I can send you.

This baby will take your words and make bits for you.

Private Sub Form_Load()
ReDim RW%(100) 'Read Words 0 to 100

Comm1.PortOpen = True

T = Timer + 1

Do While Timer < T
If ReadTable(0, RW%()) Then
For ST = 0 To 99
N9_Word(ST) = Str(RW%(ST))
Next ST
End If
Loop

For ST = 0 To 99 Step 1
Backward_Bits = 0
S = 0
I = N9_Word(ST)
N = 32768

For J = 0 To 15
K = Int(I / N)
N9(ST, (J)) = CStr(K)
I = I - K * N
N = N / 2
Next J

For Bit = 0 To 15
Backward_Bits = Backward_Bits & N9(ST, (Bit))
Next Bit

For Bit = 0 To 15
N9(ST, (Bit)) = Left(Right(Format(Backward_Bits, "0000000000000000"), Bit + 1), 1)
Next Bit
Next ST
End Sub

I will send the bas module and samples.

Just contact me via [email protected]

I do not sell code, the VB samples all work as is at 38,400 baud or 19,200, I will also send you an RSLogic file as well so you don’t have to think about itm you can just tweek what you need.

Best of luck

Kevin MacMillan
 
Top