FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
vleeuwen
Beiträge: 1569
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von vleeuwen » 04 Mai 2014, 00:24

There exist some issues with FtMscLibEx (.NET framework 4 and 4.5) and Windows 7 and 8(.1) x64; support for MS-Visual Studio 2010/2012 and 2013 when used at managed code level (VB.NET , C#).
These will be resolved in about 2 weeks.

The FtMscLibEx is part of the Extended FtMscLib package as publish on the fischertechnik web site:
PC Programming Robo TX controller extended version (prototype, with events).
http://www.fischertechnik.de/home/downl ... uting.aspx
http://www.fischertechnik.de/home/downl ... d-125.aspx

kim366
Beiträge: 12
Registriert: 18 Apr 2014, 20:09

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von kim366 » 05 Mai 2014, 13:35

This is for C++ or is it for VB too? If yes, then how do I install it?

vleeuwen
Beiträge: 1569
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von vleeuwen » 07 Mai 2014, 16:57

FtMscLibEx.dll is an unmanaged dll.
It can be us as replacement for the FtMscLib.dll
And can be used in the same way.
See also the documentation of the FtMscLib and the documentation of the FtMscLibEx.
You will find these documentation in the packages.

An event driven .NET version for the FtMscLibEx chapter 2 and 3 API will add soon to the package.
This will enable the direct use of VB.NET with MS-VS 2010 2012 or 2013 in WIndows 7 and 8

Benutzeravatar
schnaggels
Beiträge: 389
Registriert: 31 Okt 2010, 23:14
Wohnort: Kelkheim
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von schnaggels » 08 Mai 2014, 08:42

Thanks Carel, this sounds great.

Regards,
Thomas

vleeuwen
Beiträge: 1569
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von vleeuwen » 08 Mai 2014, 12:36

It is more an illustration by the 4 base API function that Fischertechnik put in into the FTMscLibEx :
These 4 callback are controlled by masks to enable the individual action for each Input, Counter or DisplayButton.

And also the STARTMOTOREXCMD4, which enables the possibility to have 1 master and 0..3 slave motors synchronice. Extended API function of the STARTMOTOREXCMD .

Code: Alles auswählen

[u]3.X1A SETCBUNICHANGED[/u]
[b]void SetCBUniChanged (void (__stdcall *) cbFunct (DWORD devId, DWORD ioId, DWORD Value, DWORD Overun, [code]
UINT8 mode, BOOL8 digital, void *context ))[/b]

Function installs to the library the specified callback function that reports the change of an “Universal-Input” .
Callback function parameter:
Call:
DWORD devId - controller ID (master or extension controller)
DWORD ioId - index of the universal input (0=I1 to 7=I7)
DWORD Value – depend of the configuration setting for this Input
DWORD Overun – depend of the configuration setting for this Input
UINT8 mode – Mode (see TA_CONFIG struct 9.5)
BOOL8 digital - Digital/Analoque (see Uni input configuration)
void *context -pointer to the context
Since: central registration now (since v4)

3.X4A SETCBCNTINCHANGED
void SetCBCntInChanged (void (__stdcall *) cbFunct (DWORD devId, DWORD cntId, BOOL state, void *context ) )
Function installs to the library the specified callback function that reports the change of a “Counter-Input” .
Callback function parameter:
Call:
DWORD devId - controller ID (master or extension controller)
DWORD cntId - index of the Counter input (0=C1 to 3=C4)
BOOL state – actual state of the input
void *context -pointer to the context
Since: central registration now (since v4)

3.X7A SETCBCOUNTERCHANGED
void SetCBCounterChanged (void (__stdcall *) cbFunct (DWORD devId, DWORD cntId, DWORD count, INT16 mode, void *context ))
Function installs to the library the specified callback function that reports
the change of a “Counter” .
Callback function parameter:
Call:
DWORD devId - controller ID (master or extension controller)
DWORD cntId - index of the Counter input (0 =C1 to 3=C4)
DWORD count – actual counter value
INT16 mode - Mode (see TA_CONFIG struct 9.5)
void *context -pointer to the context
Since: central registration now (since v4)

3.X10A SETCBBUTTONCHANGED
void SetCBButtonChanged (void (__stdcall *) cbFunct (DWORD devId, DWORD buttonId, DWORD duration, BOOL16 pressed, void *context) )
Function installs to the library the specified callback function that reports
the change of a “Counter” .
Callback function parameter:
Call:
DWORD devId - controller ID (master or extension controller)
DWORD buttonId - index of the Button input (0 =right 1=left)
DWORD duration – counts that the button was pressed (after release),
BOOL16 pressed - 1=pressed
void *context -pointer to the context
Since: central registration now (since v4)
[/code]

Code: Alles auswählen

[u]3.13A STARTMOTOREXCMD4[/u]
[b]DWORD StartMotorExCmd4 (HANDLE fthdl,int devId,int mIdx,int duty,int mDirection,int s1Idx,int s1Direction,int s2Idx,int s2Direction,int s3Idx,int s3Direction,int pulseCnt)[/b]

Function activates the intelligent motor mode for motor synchronization. The motor moves to the desired position using the shared counter information. The application shares the information that the motor has reached the end position by using a previously installed callback function (see also SetCBMotorReached() or SetCBMotorExReached() ).

The function is able to managed 1,2 or 3 slaves. However all motor have their proper CBMotorExReached notification.
Call:	
HANDLE  fthdl - 	current handle of the ROBO TX Controller
int devId -		controller ID (master or extension controller)
int mIdx - 		motor index (0 to 3) from master (motor)
int duty -		duty value for master/slave motor
int mDirection - 		direction for master motor (0= CW, 1= CCW)
int s1Idx -		motor index (0 to 3, -1 or 255 not in use) from slave1 (motor)	
int s1Direction - 	direction for slave1 motor (0= CW, 1= CCW)
int s2Idx -		motor index (0 to 3, -1 or 255 not in use) from slave2 (motor)	
int s2Direction - 	direction for slave2 motor (0= CW, 1= CCW)
int s3Idx -		motor index (0 to 3, -1 or 255 not in use ) from slave3 (motor)	
int s3Direction - 	direction for slave3 motor (0= CW, 1= CCW)
int pulseCnt - 		number of count pulses for moving to a position,
relative to the starting position

Return:
 	 DWORD errCode - FTLIB_ERR_SUCCESS (no error) or error code
Note: 
        Need to wait for  a CBMotorExReached for  each  motor in use (JOIN).


Benutzeravatar
thomasdr
Beiträge: 136
Registriert: 02 Nov 2010, 17:00
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von thomasdr » 20 Mai 2014, 22:10

Thanks for the work.
The C version was going well.
Since I can better BASIC, I'm waiting like anything else on the final version.
Greeting Thomas

andruschenka
Beiträge: 2
Registriert: 27 Nov 2014, 08:29

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von andruschenka » 28 Nov 2014, 10:24

Hallo,

ich bin neu in diesem Forum und habe eine Frage zur Benutzung der FtMscLibExNet_package im VB.NET example (http://www.fischertechnik.de/ResourceIm ... ?raid=6730):

Ich erhalte immer die Fehlermeldungen: File does not exist. ftMscLibEx.dll. Exception 1. Ich habe die dll ins Projektverzeichnis getan und ins Windows\System32 (wo sie allerdings aus Sicherheitsgründen gesperrt wird, was ich scheinbar nicht ändern kann). Der FtMscLibEx.dllPath ist in der FtMscLibExNet.dll leider auch eine Konstante. Ich habe auch die "C++ redistributable" in 32 und 64 Bit installiert, was auch nichts änderte. Komplett in 64 Bit läuft das Programm auch nicht, RoboTxTest (http://www.fischertechnik.de/ResourceIm ... ?raid=7788) dagegen schon.

Ich brauche also etwas Starthilfe - vielen Dank dafür schonmal im Voraus.
Vielleicht gibt's ja schon eine fertige Anleitung, die ich nicht gefunden habe.

andruschenka



Sollte diese Anfrage nicht hier her gehören, bitte verschieben.

vleeuwen
Beiträge: 1569
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von vleeuwen » 28 Nov 2014, 12:02

Your problem has to do with the search path for the unmanged dll (FtMscLibEx.dll).

The FtMscLibExNet.dll is an assembly dll (.NET framework).

The best thing to do in case of problems is to put the FtMscLibExNet.dll and FtMscLibEx.dll in the same directory as the application
(see also the seeting for the exe and output in the project setting of your visual studio project).
Don't forget to add the right reference to FtMscLibExNet.dll in your VB or C# project settings in Visual Studio.

The FtMscLibExNet.dll is a .NET framework assembly and can be use in all .NET dialect (languages) like: VB.NET, C# Python.NET, etc.

When you distribute/run your application outside Visual Studio it is also recommended to put the FtMscLibExNet.dll and FtMscLibEx.dll in the same directory as the application.
It is possible to make use of the GAC and the global search path for the unmanged dll (FtMscLibEx.dll). However this depends on the local setting of your MS-Windows system.
I hope this will help to solve your problem, otherwise contact me by e-mail ft.info@inter.nl.net (notes this e-mail will change at the end of this year)

vleeuwen
Beiträge: 1569
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von vleeuwen » 28 Nov 2014, 12:42

In case of problems with the FtMscLibExNet based problems, do not hesitate to contact me or fischertechnik support.
What I need is a description of the problem and a zip file with the Visual Studio 2010 or 2012 project file structure.
To keep this zip small, please remove the file that are produce during the compilation and link process.

andruschenka
Beiträge: 2
Registriert: 27 Nov 2014, 08:29

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von andruschenka » 28 Nov 2014, 18:26

Dear vleeuwen,

thank you for your response. I finally solved the problem by copying the ftMscLibEx.dll into bin\Debug\x86 directory. Now I can start/stop the motor by pressing the keys. Regarding your 2nd response: I basicly used the code I mentioned with some extra MsgBoxes for debugging.

Thank you for your support!

andruschenka

vleeuwen
Beiträge: 1569
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von vleeuwen » 28 Nov 2014, 20:39

The bin\Debug\x86 (or x64) is in your case also containing the .exe (application).
For the application this directory is the default in which the application is looking first for the dll's.

Success with program development at .NET framework level.

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: FtMscLibEx and Windows 7/8.1 x86/Win32 ,x64 issues

Beitrag von Dirk Haizmann ft » 18 Dez 2014, 15:29

.. ich denke diese Thema ist geklärt!

ft

Antworten