Welcome, Guest.
Please login or register.
Creating ,dec
Forum Login
Login Name: Create a new account
Password:     Forgot password

XBLite Forum    General Boards    XBLite Programming  ›  Creating ,dec
Users Browsing Forum
No Members and 1 Guests

Creating ,dec  This thread currently has 3,770 views. Print Print Thread
1 Pages 1 Recommend Thread
Peters
January 16, 2011, 12:01am Report to Moderator Report to Moderator
Baby Member
Posts: 6
Hi, Im new to XBLite but have used vb within MS Access. Ive wriiten a program successfully using XBLite but have a problem incorporating an external DLL. I previously used inpout32.dll in vb wich was great (Writing to Parallel Port). Can i use it here and if i do what does the .DEC file require in it. Please dont be too technical, in fact a copy of such code would be great. If you have another DLL which will do the job, please let me know, and if possible send me he DEC file to use with it. Thanks.
Logged Offline
Private Message Private message
XBLiteAdmin
January 16, 2011, 3:15am Report to Moderator Report to Moderator
Administrator Group
Posts: 44
Yes, you can use inpout32.dll with XBlite. But to call the exported functions directly, you need two things. The DEC file and also a LIB file.

The DEC is simply a listing of the exported functions:

EXTERNAL CFUNCTION Out32(SSHORT PortAddress, SSHORT data)
EXTERNAL CFUNCTION SSHORT Inp32(SSHORT PortAddress)

But you also need to create a LIB file as well. I have created the LIB file and a short xblite test file (based on the C test file) to see if it works.

See attached file inpout32.7z. In contains all the necessary files.

Hope this helps.

D.



Logged Offline
Site Site Private Message Private message Reply: 1 - 6
Peters
January 16, 2011, 2:55pm Report to Moderator Report to Moderator
Baby Member
Posts: 6
Hi, Im very impressed by quick and accurate response. Great. I was not too sure where to put .def file but understood the rest, and it helped me to understand xblite better. The good news is, is that it all works and i am very grateful for your help, which was second to none. keep up good work. Thanks again Petes
Logged Offline
Private Message Private message Reply: 2 - 6
XBLiteAdmin
January 16, 2011, 11:09pm Report to Moderator Report to Moderator
Administrator Group
Posts: 44
You don't really need the DEF file. It is only needed when you build a LIB file.

Glad I could help you out.

D.
Logged Offline
Site Site Private Message Private message Reply: 3 - 6
Peters
January 16, 2011, 11:38pm Report to Moderator Report to Moderator
Baby Member
Posts: 6
Hi, Ok. Upon using it further i have come across something that is completely foxing me. (it dont take much).
When using the Out32 inside a loop (FOR-NEXTor DO-LOOP) the loop operates normally up to about 27 then incements to a 7 digit number (eg. 4198662) and so corrupts the loop. For info i am using XP Home.
Im attaching my .x to see what happens for you. It is short without all the operations i need, but should show my problem.
Thanks, im off to bed now.



This post contains attachments; to download them you must login.

Logged Offline
Private Message Private message Reply: 4 - 6
XBLiteAdmin
January 17, 2011, 9:08am Report to Moderator Report to Moderator
Administrator Group
Posts: 44
Quoted from Peters
Hi, Ok. Upon using it further i have come across something that is completely foxing me. (it dont take much).
When using the Out32 inside a loop (FOR-NEXTor DO-LOOP) the loop operates normally up to about 27 then incements to a 7 digit number (eg. 4198662) and so corrupts the loop. For info i am using XP Home.
Im attaching my .x to see what happens for you. It is short without all the operations i need, but should show my problem.
Thanks, im off to bed now.


Hi,

Sorry for the problem. It looks like the functions needed to be declared slightly differently:

EXTERNAL FUNCTION Out32(SSHORT PortAddress, SSHORT data)
EXTERNAL FUNCTION SSHORT Inp32(SSHORT PortAddress)

I had declared them as CFUNCTION which will treat values on the stack differently than when declared FUNCTION.

So I have attached the file again with a new version of LIB. Hopefully this will work better!

D.




This post contains attachments; to download them you must login.

Logged Offline
Site Site Private Message Private message Reply: 5 - 6
Peters
January 18, 2011, 11:12pm Report to Moderator Report to Moderator
Baby Member
Posts: 6
Hi Thanks for new download etc, I've used it now to quite an extent and all seems well (Except for my silly mistakes). Im sure my lights will be flashing pretty patterns very soon. Cant thank you enough for you help. I live in Gloucesterhire, England by the way.

Ta Peters
Logged Offline
Private Message Private message Reply: 6 - 6
1 Pages 1 Recommend Thread
Print Print Thread

XBLite Forum    General Boards    XBLite Programming  ›  Creating ,dec

Thread Rating
There is currently no rating for this thread