Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interfacing LPT1 with VB6

Status
Not open for further replies.
Ill try what you attached. Hoping it work or helps.
...After seeing urs I was wondering to add more.
I would like the shape to blink every second as it checks every second even if its constantly "high" and sure if than if its "low" it can go red, but again flashing every second to indicate as if its "working".
I guess using shape.visible=true/false statement in a timer or loop?
 
Last edited:
I'm having trouble to get this program to interact with another form( as just a simulation form) if added. So it passes on the variable states/information, ie. when a certain state has happened than the process in the other form halts the hardware from a single instruction when it sees that change of state, but the other form continually(the first form made) keeps running. Its for a "safety" feature.
 
pablome said:
I'm having trouble to get this program to interact with another form( as just a simulation form) if added. So it passes on the variable states/information, ie. when a certain state has happened than the process in the other form halts the hardware from a single instruction when it sees that change of state, but the other form continually(the first form made) keeps running. Its for a "safety" feature.

Hi,
Like to help you, but I don't understand your post?:confused:
 
Ok I'll maybe send what I have so Far. Or changed.
"ActiveRobot.zip" attachment holds some examples and info with what would relate to the robot arm being used.
**broken link removed**
Attch. called TestingWithSingleForm, Is he single Form/Module that tests the LPT1 Pin10. It than should than have AbortFlag global variable go True if pin10 is low. As it does than it stop the Date/Time label from showing the updated Date/Time while using "DoEvents" to continually still check for Status of Pin10 and when high again, then AbortFlag=False and time continues. That is just a simulation using a timer for every second checks.

The real works is to use "RobotObject.Abort" command whenever pin 10 is Low inside the timer AbortFlag check. Use "RobotObject.ClearAbort" when the pin 10 is high again, to resume where the robot arm has left of.

Gonna similuate this with a form code that will move the arm between 2 points and interupt it(pause it-safety feature) when AbortFlag =1 or pin10 is low.

Was thinking of doing this between two separate forms but wasn't able to pass variables between them correctly and I'll try with single form and module for now.

Ill try to show what I mean in a sketch code in VB lets say.

Also added "sketch code"
 

Attachments

  • TestingWithSingleForm.zip
    3.9 KB · Views: 153
  • SketchCode.zip
    3.9 KB · Views: 144
Last edited:
hi pablome,
Downloaded your files, it will take a little while to look them over.
 
Ok No problem. Ill try to work and see what I can do , but I hope my low VB skills dont slow me down and hopefully if work together could make it more efficient/better with maybe added things when at least the base workings are fine.

I can try to explain better if confused.
 
Last edited:
pablome said:
Ok No problem. Ill try to work and see what I can do , but I hope my low VB skills dont slow me down and hopefully if work together could make it more efficient/better with maybe added things when at least the base workings are fine.

I can try to explain better if confused.

hi,
Tried running your programs, but a number of files are missing.
'RobotObject as CRSRobot', 'Controller as New'''' and IOOCX.ocx plus some others, its proving a little difficult to determine whats missing in total, I'll keep trying.
 
**broken link removed**

For Activerobot program install files.


Also I think at the moment can only try to implement a VB code and not really test it though but a working model lets say. Reason is I thin you need controller hardware to and robot arm it self to get the whole scenario working.

In the code I want to add some movement instructs. for the robot and for them to pause when there is PIN10 interruption, using the 1sec timer and DoEvents feature in VB code.
"Passing aguments" in the VB code, as to which point(1 or 2, like left right) which would be the movement of arm, is to be added offcourse, which Im not sure of the exact movement instruc. or how to pass that data in function.
"Abort" and "ClearAbort" are gona be used....see Help File for more info.
Also "Using ActiveRobot Objects In Visual Basic " & "Creating ActiveRobot Applications In Visual Basic 6.0"in the help menu file...cuz we need the reference library- CRS ActiveRobot `.` Type Library.....when we have installed the program.
Gota use those examples of VB included, cuz I started doing so since I'll need to at form load(like in ex.) load a V3 file(the co-ordinates, in binary), those have to be loaded first....then Ill have to put in movement intrucs'.
Oh yes and the dll's are important.

Actually "PendantVB.vbp" example might as well be usefull for action of the robot and the other program I started before to implement together to have a "safety stop" with abort/clear abort instructs. whn PIN10 status changes.
 

Attachments

  • sofarA.zip
    4.6 KB · Views: 135
  • PendantVB.zip
    3.1 KB · Views: 138
Last edited:
hi pablome,
I have downloaded all the zip files, its well over 20MBytes of zipped data!.

The 'activerobot.zip' is the program installation file, no source code?
Also there are number of *.ocx files missing for your VB programs.

Without the source code I cannot offer any better advice, other than that you contact the original author of the program and ask him to make the changes for you.

Sorry I cannot be of more help.

Regards
 
how can i modify an dll.
thats interrupting when an instruction is done causing an error msg and closing the program.
Or else I need to create some error handling.
 
Last edited:
pablome said:
how can i modify an dll.
thats interrupting when an instruction is done causing an error msg and closing the program.
Or else I need to create some error handling.

Hi Again,

Look at these two links.
https://www.softpedia.com/get/Programming/Debuggers-Decompilers-Dissasemblers/PE-Explorer.shtml
https://www.angelfire.com/biz/rhaminisys/vboledll.html

Make a backup of the original DLL before you modify it, rename the backup, in case you have to go back to it.
If you do go back to the original DLL make sure you use the original name.

To test your version of the DLL, write a diagnostic 'noddy' VB project.

You should always have 'on error' trapping in your VB programs.

Look at the VB help files for 'on error' samples.

Eric
 
I guess Ill have to reinstall VB to get the help files on Error handling.
Last time I opened up a Dll it was binary or hex.
 
pablome said:
I guess Ill have to reinstall VB to get the help files on Error handling.
Last time I opened up a Dll it was binary or hex.

hi,
The DLL's are in hex, if you want to try to read them as source code, you will need a dis-assembler.
Most likely the source will be disassembled without comments.

I dont envy you trying to re-engineer DDL's without the source code!

Did you download that 30 day trial program for DLL's I posted earlier.
That will give you an idea of the complex task you have.

Eric
 
I might not work with the dll.
But I want to add some error handling that traps an error that is invoked by the program internally by the required dll thats used to move robot.
the Abort command(in vb code) halts the robot but after its executed a small error window says an abort has happened, and closes the vb exe program i made.
need to trap that message/error so program doesnt close.
 
pablome said:
I might not work with the dll.
But I want to add some error handling that traps an error that is invoked by the program internally by the required dll thats used to move robot.
the Abort command(in vb code) halts the robot but after its executed a small error window says an abort has happened, and closes the vb exe program i made.
need to trap that message/error so program doesnt close.

hi,
In subr thats causing the error, write an error handler.
ON ERROR GOTO FAIL1
code.........................

EXIT SUB
FAIL1:
MSGBOX "ERROR = " & ERROR$
..... THEN what to do regarding the error

EXIT SUB

This will give you a clue to whats causing the error.
 
Ok I'll try what you added. But already did try I think to this similar thing.

Private Sub cmdAbort_Click()

RobotAbort.Abort

End Sub

When RobotAbort.Abort is ececuted it halts robot movement.

But than it displays aerror message : Run time Error...""-1610350578 (a00400e)"

Some times even with "-1610612720 (a0000010)" resource busy" ....at different occurrences.

I was able to lets say, make a msg display but than the integrated error pops up, and pretty much closes program.
 

Attachments

  • errors.zip
    54.2 KB · Views: 178
Last edited:
ActiveRobot

ActiveRobot doesnot seem to be complete. Some Ocx files are missing and it makes me think it should have a setup file. The Zip file in the following address doesnot have it.
**broken link removed**
I would like to have this software. Where can I download it?

Thanks
 
I know it has been a while on this thread but I'm running to the same problems but with vc++. I'm trying LPT1 to vc++ 2005 express edition, and I'm using Windows XP SP2 and have the administrative rights of the computer. I downloaded "inpout32.dll" and placed it in C:\Windows\system32 directory and basically used:
#import "C:\Windows\system32\inpout32.dll"
and added inpout32.lib as an additional dependency (Project properties --> Linker ----> Input). However, when I try to run the program I get this error: "fatal error C1083: Cannot open type library file: 'c:\windows\system32\inpout32.dll': Error loading type library/DLL."
I have been struggling with this for few days now and I have searched alot for my solution but I noticed the author of this thread found a solution to interface it with vb, so any helpful hints will be appreicated.

Thanks
 
DoorLock said:
ActiveRobot doesnot seem to be complete. Some Ocx files are missing and it makes me think it should have a setup file. The Zip file in the following address doesnot have it.
**broken link removed**
I would like to have this software. Where can I download it?

Thanks
As my understanding you should get it from the manufacturer, that's how I got it anyways to control my CRS robot.
 
Status
Not open for further replies.

Latest threads

Back
Top