LibFunc Help / FP Error

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

LibFunc Help / FP Error

Post by Me_again » Sat Aug 20, 2005 4:06 am

I'm trying to use the dll for a LabJack USB datalogger. For this simple test I need to pass -1 or a serial number but if I try to pass a number with "ref:" I get an "invalid floating point operation". I've tried using Let and also sending the number directly eg ref:-1".

LibLoad>ljackuw,hDll
Let>idnum=-1
MessageModal> %idnum%
LibFunc>hDll,GetFirmwareVersion,firmwareVersion,ref:idnum
MessageModal>Firmware Version Response: %firmwareVersion%
LibFree>hDll

This is with 7.3.11.4 Pro.

Any suggestions how I might make this work?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sat Aug 20, 2005 8:19 am

Looks like there may be a bug with LibFunc and negative numbers. We will investigate.
MJT Net Support
[email protected]

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Aug 28, 2005 3:30 pm

Hi, I tried the 7.4 beta 008 and it's looking better, no flop error, but not fully working yet.

This is the code:

LibLoad>ljackuw,hDll
Let>idnum=-1
MessageModal> %idnum%
LibFunc>hDll,GetFirmwareVersion,firmwareVersion,ref:idnum
MessageModal>Firmware Version Response: %firmwareVersion%
LibFree>hDll

There are two valid values for idnum, -1 and the device unique serial number. Using either of those returns a firmwareversion of 0 (zero). Using any other number results in getting a 515 error code (which is to be expected).

Per the vendor the device returns firmwareversion as a float = 1.100.

Do we have to define this some way in macroscheduler so that it can be read correctly?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Aug 28, 2005 9:14 pm

Unfortunately LibFunc supports integers and strings only.
MJT Net Support
[email protected]

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Aug 28, 2005 9:31 pm

Thanks for the info :(

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Aug 29, 2005 7:35 pm

support wrote:Unfortunately LibFunc supports integers and strings only.
Labjack support suggests including this integer limitation in the help for LibFunc (seems like a good idea to me too).

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Aug 29, 2005 7:53 pm

The 7.4 documentation has already been updated to reflect this. We are also looking at the feasibility of supporting more data types.
MJT Net Support
[email protected]

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Aug 29, 2005 8:27 pm

Thank you, that would be very nice.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts