Sign in to follow this  
Followers 0
Justin27

VB6 to slc500 via opc

6 posts in this topic

I am attempting to write a simple VB6 opc client. The sample code I downloaded from the rockwell website has a line that gives me a run time error Set Mydata = Mygroups.OPCItems.AddItem(plcdata1,L1, C1 , 1) What does the C1 and L1 mean? Justin

Share this post


Link to post
Share on other sites
That's the usual syntax when the client is Microsoft Excel. "L1, C1, 1" means 1 line, 1 column per line, 1 item.

Share this post


Link to post
Share on other sites
There are several things to check here but runtime error from vb6 isn't much to go on. You downloaded Rockwell's sample code which is based on certain assumed names for target plc. Did you name your SLC program correctly and size the data tables as the sample needs? For the sample to work RSlinx needs to be the correct version and configuration to work with the sample. Do you have a version of RSlinx which supports OPC? or the ocx/dll loaded into your pc executing the program. Finally there are lots of locations for typo's and such. Can you run the vb6 app in debug mode and pinpoint exactly where in code and form the app is runtime erroring? Can you provide the link to the sample you downloaded so we can check your error message out against the source?

Share this post


Link to post
Share on other sites
Do you have RS-Linx OEM or Gateway, or a third party OPC server? RS-Linx lite does NOT support non-Rockwell OPC software (you have to buy a license but any license works).

Share this post


Link to post
Share on other sites
If you can get a hold of a copy of rslinx trainer ,it explains that in a slc that if you change L1 to L3 as part of the additem you would get three values back.In the trainer t4:0,acc L1,C1 would be The value of timer t4:0. Change to L3,C1 and you would get T4:0 acc ,T4:1,acc and T4:acc. The trainer started on this subject.It might be possible that the demo version might .

Share this post


Link to post
Share on other sites
I have my VB6 app turning on bits and loading intergers in to my slc503 via OPC I use the "MyData3.Write (1)"- This sets a bit. But I can't seem to read out of the PLC using "Mydata3.Read(1)"- one is the item number. Any Ideas Justin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0