Livecode and Biopac Interface - interface

My lab recently purchased the BIOPAC system to measure skin conductance as part of our experiments.
My experiments are normally coded using Livecode.
I need to be able to tell Livecode to automatically score and label digital event marks in the skin conductance responses in the BIOPAC System.
Does anyone have any experience interfacing the BIOPAC system and Livecode? Does anyone have same code they have used?
Thanks!

There is a gadget from "Bonig und KallenBach":
http://www.bkohg.com/serviceusbplus_e.html
This has analog inputs that you could easily configure to measure skin resistance. It comes with a framework for LiveCode, and connects through the USB port.
I have used these in many applications to connect the real world to my computer. All your processing is done in the usual LC way.

I think, there is no direct Example using Biopac Hardware.
To tinkering with your own software outside AcqKnowledge, you have to purchase BHAPI (MPDEV.dll) from Biopac. The problem is BHAPI only support Windows. not MacOS nor Linux.
Another way is streaming data through AcqKnowledge 5.x. Start acquisition in AcqKnowledge, and you can stream it. Then receive the data stream in livecode and process it.

Related

Connecting CAD model (Solidworks, AutoCAD or CATIA) with realtime measurements from Raspbery Pi or Arduino Sensor

To present my question I will simplify my example.
I will connect a sprocket on a step motor and measure acceleration with an accelerometer. The data will be captured by using either an Arduino or Raspberry pi sensor setup. The measurements will then be stored in a cloud-based environment or somehow similar and be send to the CAD model (that's the idea).
Basically what I would like to achieve is to:
connect the movement of the step motor with the SW/CATIA/AutoCAD model (if the physical sprocket is spinning, so is the one in the CAD model),
in case that the measurements identify a problem in the assembly, the critical/weak component would be somehow highlighted inside the CAD model.
Has anyone an idea how this could be done or if it is even possible?
I think is definitely possible (and quite easy) in CATIA (which is the only one I know).
CATIA has COM Automation exposed (i.e. you can interact with it like you do with MS Office apps) and naturally you would to it writing VBA project in the same fashion .
But VBA projects have a lot of limitations, and I think it would be almost impossible to have a background, constantly running process such as the one you describe.
If you switch to Python, you'll be able to:
access all python functionalities, in the scope you describe I think you'll have endless possibilities in getting data from a sensor and handle them, then send to the CAD.
run the script whenever you want, totally independently from VBA editor and CATIA macro related stuff. It will just send commands to CATIA and it will instantly execute.
have everything in real time, because if you enable Automatic Update in CATIA, each command sent via COM will be immediately executed and the Part or Product updated accordingly
I already translated a complex project from VBA to Python with success, it interacts seamlessly with CATIA and Excel at the same time and transfer data between them.
It is definitely possible, look what has already been done with Solidworks and MS Kinect.
All you need to do is identify the component that you want to affect, calculate new transform based on your sensor input and assign that transform to the component.
To highlight you can either change color of the body or use built it Highlight method.
That being said I wouldn't recommend this as your first Solidworks project.

Get EV3's serial number from program

I'm going to sell a lego mindstorms EV3 appliaction and I want to protect it. I'm not going to sell source code, only the compiled code so it's not possible to edit it. And to stop anyone from sharing it, I'd like to protect it somehow. The only way I found is to get EV3's s/n or any similar number that's uniquie in every EV3, it'd be easy. So, is this possible? Or are there any other ways to protect my program from sharing it? Thanks!
I am not aware of a serial number that can be read via code. You could use the MAC address of the bluetooth module.

DH-11 Sensor on a Raspberry Pi

I am trying to make my DH-11 sensor work on my raspberry pi but I have not succeeded after several attempts. I followed the following tutorial from Adafruit:
https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging
My attempts were unsuccessful. I just do not get any feedback whatsoever from the sensor. I know that both my DH11/DH22 sensors do work because I do read data from them if I do the same circuit using my arduinos and run a script. I also don't think my raspberry's GPIOs are damaged in any way since I tried with like 5 and I didn't get any data.
I am not trying to log stuff to a google doc like the tutorial does, I am just trying to read data from the sensor using the raspberry.. I have plans to log the data in a server an access it remotely... But for that I have to get readings from the sensor first.
Now, has anyone achieved this? Reading data from a DH11/DH22 in the raspberry pi? If so, could you tell me which tutorial you followed? I've been looking for some out there but it seems that Adafruit's is by far the most popular one.
Thanks for your help!
Cheers!
We just found a solution by using the following:
commenting out the blacklist as discussed here
and, doing the following as directed here:
better choice: sudo raspi-config
elect “Advanced Options”
then either “SPI” or “i2C” and enable the interfaces there
“YES” to load driver modules automatically
I found the details for setting up the DHT22 quite simple. I followed thispi.com instructions. I have had issues with the sensor itself and that may be your problem. My first one was a dud, but the second one I connected worked great.

Directly connecting two Arduino Yun boards to each other

I am trying to connect two Arduino Yun boards to each other via WIFI (make one board control a pin on the other board an vice versa) and I am having trouble making it work the way I want to.
This is where I've gotten so far:
I have two Arduino Yun boards with a simple sketch installed on each, which works fine as long as I keep the "connecting-each-other"-part out of it. It uses a potentiometer on the analog port, reads its value, maps it to the range of 0-255 an fades a LED up or down on one of the digital pins (brighter / darker) depending on the given value. Now I want to use the potentionmeter of one board to control the LED on the OTHER board.
To do that, I tried to use the REST API. I combined my sketch with the code from the "Bridge" Example Sketch, which sets up a http-client/server on the Arduino Yun (on the Linux part) allowing it to receive requests to control and read patricular pins via http.
When using the specific URL for the REST API in a browser, it works fine. For example: when I type "http://myarduino.local/arduino/digital/3/1" it sets the value of digital pin 3 to 1 (i.e. LED is switched on) --> so that's all fine
I am not sure how to continue at this point, since I dont want to control the board from a browser or app but make one Arduino Yun control another Arduino Yun directly. If I put a http request in my sketch like mentioned above via client.get and client.read (as in the example sketch) it does not work. See example code below. It doesnt have any effect nor does anything appear in the serial monitor (with the original URL "http://arduino.cc/asciilogo.txt" like in the example, the ascii code appears in the serial monitor)
HttpClient webclient;
webclient.get("http://ardu1.local/digital/3/1");
while (webclient.available()) {
char c = webclient.read();
Serial.print(c);
}
Serial.flush();
I am a beginner with Arduino Yun boards and maybe I am missing something?
Thanks for any help or pointing me in the right direction. Or if you need more information to help me with this problem, please let me know.
I found another way to connect two Arduino Yun boards directly, or as close to "directly" as it probably gets. The REST API was not the right way to go. So this is for anyone who might encounter the same "problem":
After some research I came across "Spacebrew". It's based on "websockets" and requires a server to connect the boards to each other, but it is very flexible. It's also fairly easy to setup a spacebrew server locally. It allows every client (like a Arduino Yun board) connected to the server to publish different types of data (boolean, range, value) and/or to subscribe to the published data from other devices using a simple webinterface. The good thing is, that the connection is fast and there's no waiting for the connection to be reestablished when there is data to be sent.
I used the Arduino Example Sketch "spacebrewRange" and it worked fine for me.
It also requires a few other things before it can work, but its explained on the website and in a tutorial:
http://docs.spacebrew.cc/gettingstarted/
http://de.slideshare.net/julioterra/spacebrew-server-workshop-itp
Trying to do the same, it seems, and for me it works (this bit at least :-|
I let one arduino request the URL "http://router.domain:port/arduino/key/value", using a Process which runs cURL. The receiving arduino interprets this request to set the key to the value, using a YunClient.
From the URLs in your question, it seems that you are missing the mandatory "/arduino/" component in the path name. As far as I know, this is needed to direct any requests directed at the OpenWRT stack to the arduino/Leonardo part.

best tool to reverse-engineer a WinXP PS/2 touchpad driver?

I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm trying to find out what message it is sending but I'm not sure how to start. Would software like "Syser Debugger" work? I want to intercept outgoing messages being sent to the PS/2 bus.
IDA Pro won't be much use to you if you want to find out what 'messages' are being sent. You should realise that this is a very big step up for most web developers, but you already knew that?
I would start by deciding if you really need to work at the driver-level, often this is the Kernel level. The user mode level may be where you want to look first. Use a tool like WinSpy or other Windows debug tool to find out what messages are getting passed around by your driver software, and the mouse configuration applet in control panel. You can use the Windows API function called SendMessage() to send your messages to the application from user mode.
Your first stop for device driver development should be the Windows DDK docs and OSR Online.
I suggest reading the synaptics touchpad specs (most of the touchpads installed on notebooks are synaptics') available here http://www.synaptics.com/decaf/utilities/ACF126.pdf
I believe on page 18 you'll find the feature you are looking for. At least you'll know what to expect.
So, very likely, the touchpad driver "converts" the command coming from user mode to this PS/2 command.
I don't know the specifics of the touchpad PS/2 driver but I see two major ways for the user mode panel to communicate with the driver:
- update some key in the registry (this is actually very common)
- the driver provides an alternate "channel" that the user mode app opens and writes specific commands to
You may want to try using the process monitor from sysinternals to log registry activity when setting/resetting the feature.
As for the options 2 you may want to try IRP tracker from OSR and see if there's any specific communication between the panel and the driver (in the form or IRPs going back and forth). In this case, kernel programming knowledge is somewhat required.
The windows kernel debugger may also be useful to see if the PS/2 driver has some alternate channel.
Have a look at IDA Pro - The Interactive Disassembler. It is an amazing disassembler.
If you want to debug, not just reverse engineer, try PEBrowse Professional Interactive from SmidgeonSoft