Le Stang's Applescript Scripting Addition

Discussing the support available and any problems you may have.
b0b

Le Stang's Applescript Scripting Addition

Postby b0b » Thu Oct 09, 2008 12:03 am

Has anyone been able to get a copy of Le Stang's Applescript Scripting Addition? How did work for you?

b0b

LE STANG

Postby LE STANG » Sun Oct 12, 2008 4:08 am

Hello everyone

Sorry for the late reply but I was pretty busy during the last weeks.

YOu'll find a copy of my phidget osax @ http://lestang.org/osax/Phidgets/Phidgets.osax.zip

Please consider this as a 'beta' version even if I've been using it daily for 3 months now without a glitch, they are a few functions that have not been tested thoroughtly yet.

Basicaly to use it you have to do the following:

a - connect to the interface kit : IKConnect or IKConnect 865 (to connect to the interface kit of id 865)
b -read from the interface kit : IKRawReadAnalogicInput or IKReadAnalogicInput to read analogic inputs
c -disconnect from the interface kit : IKDisconnect when you're done with the interface kit

I've implemented other functions to use digital inputs/outputs, they are working in the very same maner.

IKReadDigitalInput, IKReadDigitalOutput, IKEnableDigitalOutput, IKDisableDigitalOuput

And a few functions to get info on the interface ki :
IKGetVersion, IKGetStatus, IKGetDigitalOutputsCount, IKGGetDigitalInputsCount, IKGetAnalogicInputsCount

YOu can read one or all the inputs/ouputs :

IKReadDigitalInput -> read all digital inputs
IKReadDigitalInput 1 -> read input 1 (the first input is 0)

This can be used on all inputs/ouputs functions.

And I'm now planning on working on triggers and being able to connect over a network and have multiple interface kit connected at the same time.

b0b

Dear Mr. Le Stang.. thank you but how do I ....

Postby b0b » Wed Oct 15, 2008 6:44 am

Dear Mr. Le Stang

Thanks for posting your scripting addition. How do you install it? Will you share your code?

Thanks again,

b0b

LE STANG

Postby LE STANG » Thu Oct 16, 2008 2:05 pm

Install the scripting addition in the following folder "~/Library/ScriptingAdditions/" you should create this directory if it does not exist yet.

Concerning the source code, it will be open sourced when I've added the few missing functionalities I've described in my previous post.

b0b

Voltage Sensor

Postby b0b » Tue Nov 18, 2008 11:52 pm

Hello Mr. Stang,

I have your scripting additions for Phidgets installed. I have a voltage sensor and I want to use an Applescript to get the voltage readout. Is this possible with your scripting additions?

Can you tell me what I am doing wrong in this script because I get the error listed.

tell application "Phidget Interface Kit"
IKConnect
end tell

Phidget Interface Kit got an error: An error of type -1 has occurred.

Thanks!

b0b

LE STANG

Postby LE STANG » Wed Nov 19, 2008 2:46 pm

This scripting addition is working with a Phidget Interface Kit, not every phidgets. BTW the scripting addition shoudl be used without the 'tell ... end tell' block, but I'm affraid you won't be able to use it on your voltage phidget if it is the one that is working without the interface kit.

b0b

Postby b0b » Wed Nov 19, 2008 3:14 pm

I'm using the 8/8/8 Interface with the 1117 voltage sensor. To get the Voltage Sensor to work with Applescript is a new scripting addition required or can an addition be made to yours? Would it be possible to get your code to use?

Thanks,

b0b

LE STANG

Postby LE STANG » Sun Nov 23, 2008 3:24 pm

then it should be as easy as :


IKConnect
IKRawReadAnalogicInput ioNum

without any 'tell ... end tell' block like the one you mentioned earlier. And BTW, you cannnot have two applications using the port at the same time, so make sure you've no other application using the phidget board.

b0b

no success

Postby b0b » Sun Nov 23, 2008 8:18 pm

Dear Mr. Stang;

in the Script Editor I wrote - IKConnect 79821 --the serial number and I get;

tell current application
IKConnect 79821
"An error of type -1 has occurred."


I type IKRawReadAnalogicInput in the Script Editor and get this;

tell current application
IKRawReadAnalogicInput
{}
end tell

My voltage sensor is #7 in the sensor list.

Thanks for your help,

b0b

Snakesitter

Re: Le Stang's Applescript Scripting Addition

Postby Snakesitter » Tue May 05, 2009 11:15 am

Hi Le! Thank you for building an Applescript addition for the Phidgets hardware, it is extremely generous of you to both build and share it publicly. I am using it to get values from two temperature sensors attached to an InterfaceKit 8/8/8.

However, I’m having the exact same problem as Bob did. When I run my code:

Code: Select all

IKConnect 29292
IKGetAnalogicInputsCount
IKRawReadAnalogicInput 1
IKRawReadAnalogicInput 6
IKDisconnect

I get the following error in line 1:

Code: Select all

An error of type -2 has occurred. (-2)

Did anyone figure out how to resolve the similar errors they were experiencing?

EDIT: related thought: does the scripting addition go anywhere else than the root Library level? Like, somewhere with the other Indigo scripts?

Thank you,

b0b

Re: Le Stang's Applescript Scripting Addition

Postby b0b » Wed May 06, 2009 5:01 am

Try using

try
IKGetAnalogicInputsCount
IKRawReadAnalogicInput 1
IKRawReadAnalogicInput 6
end try

Snakesitter

Re: Le Stang's Applescript Scripting Addition

Postby Snakesitter » Thu May 07, 2009 11:15 am

Thanks Bob. I tried that, but got the same result. :-(


Return to “MAC OS X”

Who is online

Users browsing this forum: No registered users and 1 guest