Propeller + PC Applications with LabVIEW
Andy Lindsay (Parallax)
Posts: 1,919
Propeller + PC Applications with LabVIEW
Introduction
LabVIEW is a software development environment created by National Instruments that makes it possible to write programs that interface computers with measurement and control instruments using a graphical programming language. ·We have received several requests from universities for resources that demonstrate communication between LabVIEW software and the Propeller microcontroller. ·The purpose of these resources is to help launch student projects where the lab PCs are equipped with LabVIEW, and the students create custom data acquisition and control devices with the Propeller Education (PE) Kit.
Hardware, Software and Documentation
Hardware
· Propeller Education Kit
Software
· Propeller Tool Software (v1.2.5 or newer)
· LabVIEW 8.2 or newer
· NI Serial (a free LabVIEW add-on)
·
Source Code
· LabVIEW Propeller Number Exchange Code.zip
Tutorials and Resources
· Propeller Education Kit Labs: Fundamentals (.pdf 6.93 MB)
· Propeller Manual (.pdf 4.74 MB)
· LabVIEW Training Resources
How the Application Works
A LabVIEW programs is called a VI, which stands for Virtual Instrument. ·Virtual Instruments have a front panel, like this one (Figure 1). ·Inside “LabVIEW Propeller Number Exchange Code.zip”, you will find “Exchange Int32 Values with Propeller.vi”.· When you open this VI with LabVIEW you will see a front panel similar to the one displayed in Figure 1.· Front panels provide an interface between a PC user and some combination of graphical code that communicates with the front panel and instruments connected to the PC. ·In this case, the instrument connected to the PC is the Propeller microcontroller. ·
·
Figure 1: Front Panel Example
·
On the left, there are a number of serial port settings. ·On the right, notice that there is a control labeled Value to Propeller and an indicator labeled Value from Propeller. ·When you enter an integer into the Value to Propeller control, LabVIEW serially transmits the value to the Propeller. ·The Propeller sends back the negative of the value you entered, and LabVIEW receives and displays this result in the Value from Propeller indicator. ·
·
Figure 2 shows the LabVIEW graphical program (block diagram) that takes care of the communication between the front panel and the Propeller chip. ·If you are viewing the front Panel in Figure 1, you can open the block diagram by clicking the Window menu and selecting Show Block Diagram. ·
·
The program in Figure 2 starts by configuring a VISA serial port resource with values entered into the front panel controls (the ones along the left in Figure 1, including COM port, baud rate, etc.) ·The program then follows the yellow/black (error) and purple (VISA Resource Name = COM Port) lines entering a large gray while loop box. ·Blocks inside the while loop format text and a number from the front panel and send them to the Propeller chip, and receive, format, and display the value that the Propeller chip replied with.· The code inside the while loop repeats until the STOP button control under the Terminate Serial Loop label on the front panel is clicked. ·Then, the program exits the while loop at the bottom and the VISA blocks in the lower-right of Figure 2 close the serial port resource so that the COM port is available to other programs, such as the Propeller Tool software which can then download modified programs to the Propeller chip.
·
Figure 2: VI Block Diagram
·
In a pseudo code nutshell, the VI in Figure 2 executes the following loop:
·
Start the serial port
While Loop
········· Send to serial port: “!v=” followed by 4 bytes that contain the Int32 entered into the front panel’s Value to Propeller control.
········· Get a delay value (default 100 ms) from the front panel and wait for that amount of time.
········· Get 4 byte reply from the serial port, reconstruct them into an Int32, and display it in the front panel’s Value from Propeller field
Repeat while loop if stop button is not pressed; otherwise, exit loop.
Close the serial port
·
A LabVIEW Int32 is a 32-bit integer value, which can be broken apart into 4 8-bit bytes and then transmitted. ·The VI uses a Flatten to String block to convert the front panel Int32 value to 4 serial bytes that can be transmitted via the serial port. ·The Flatten to String block can be configured to transmit bytes using big-endian, native host, or little-endian orders. ·Little-endian means that the bytes are ordered in B0, B1, B2, and B3; whereas, big-endian orders the bytes in B3, B2, B1, and finally B0. ·Native host order depends on your computer.· The native order for the Propeller chip is little-endian, so selecting that option made sense from the Propeller coding standpoint.
·
Figure 3: Flatten to String
·
For values received from the Propeller chip, the unflatten from String block receives 4 bytes in little-endian order from the Propeller and reconstructs them into an Int32, which it sends to the Value from Propeller front panel indicator. ·The Unflatten from String block needs to know if there is any header information (F = false) Boolean input, and the constant on the top is set to Int32 representation, which configures the Unflatten from String block’s output.
·
Figure 4: Unflatten From String
·
The Spin language Propeller application code shown in Figure 5 relies on the v1.2 of the FullDuplexSerialPlus object introduced in the Propeller Education Kit Labs: Fundamentals Chapter 6 to handle the serial communication with the LabVIEW application. ·The application’s repeat loop waits for the “!v=” string using the FullDuplexSerialPlus object’s waitstr method. ·Immediately after the “!v=” string arrives, the application calls the FullDuplexSerialPlus object’s GetLong method, which receives the little-endian order bytes transmitted from LabVIEW and laods them into a long variable. ·It negates this value, and transmits it back to LabVIEW using the FullDuplexSerial object’s PugLong method.
·
Figure 5: Propeller Application Code
Testing the Application
“Exchange Int32 Values with Propeller.vi” is a modified version of smplserl.llb from \LabVIEW\examples\instr that exchanges bidirectional value exchanges between LabVIEW and the Propeller Microcontroller.· As mentioned earlier, the VI transmits an Int32 to the Propeller and then receives the Propeller's response. ··
·
The accompanying Propeller “Exchange Long Values with LabVIEW.spin” application replies with the negative of the number it received from LabVIEW.· The two files working together provide a starting point for a variety of LabVIEW + Propeller microcontroller projects.
·
P······ Download LabVIEW Propeller Number Exchange Code.zip.·
P······ Using the Propeller Tool software to load "Exchange Long Values with LabVIEW.spin" into the Propeller chip.·
P······ Find out which COM port the Propeller chip is connected to by pressing F7 in the Propeller Tool.·
P······ In the VI front panel, set the VISA resource name to the Propeller chip's COM port, and then click the Run button (not Run Continuously, just Run).·
·
The Int32 in the Value to Propeller field gets transmitted to the Propeller chip, and the Propeller Chip replies with the negative of that value, which this panel displays in the Value from Propeller chip field.·
·
P······ Click Window-Show Block Diagram, which will bring up a block diagram similar to the one shown in Figure 2.
P······ Click the block diagram window's Highlight Execution and Retain Wire Values buttons to examine VI program execution.·
P······ Disable those two buttons before stopping the VI's execution (or you will have to wait for it to complete another iteration of the loop).·
P······ Stop the application by clicking the STOP button below the Terminate Serial Loop label in the front panel shown in Figure 6. ·
·
Figure 6
·
When you want to stop the VI's execution, make sure to use the STOP button in the front panel (titled Terminate Serial Loop) instead of the stop button in the button bar under the menus.· The button bar's Stop button does not allow the VI to exit its loop and close the serial port session, which could prevent the Propeller Tool software from being able to load modified programs into the Propeller chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/6/2009 1:04:45 AM GMT
Introduction
LabVIEW is a software development environment created by National Instruments that makes it possible to write programs that interface computers with measurement and control instruments using a graphical programming language. ·We have received several requests from universities for resources that demonstrate communication between LabVIEW software and the Propeller microcontroller. ·The purpose of these resources is to help launch student projects where the lab PCs are equipped with LabVIEW, and the students create custom data acquisition and control devices with the Propeller Education (PE) Kit.
Hardware, Software and Documentation
Hardware
· Propeller Education Kit
Software
· Propeller Tool Software (v1.2.5 or newer)
· LabVIEW 8.2 or newer
· NI Serial (a free LabVIEW add-on)
·
Source Code
· LabVIEW Propeller Number Exchange Code.zip
Tutorials and Resources
· Propeller Education Kit Labs: Fundamentals (.pdf 6.93 MB)
· Propeller Manual (.pdf 4.74 MB)
· LabVIEW Training Resources
How the Application Works
A LabVIEW programs is called a VI, which stands for Virtual Instrument. ·Virtual Instruments have a front panel, like this one (Figure 1). ·Inside “LabVIEW Propeller Number Exchange Code.zip”, you will find “Exchange Int32 Values with Propeller.vi”.· When you open this VI with LabVIEW you will see a front panel similar to the one displayed in Figure 1.· Front panels provide an interface between a PC user and some combination of graphical code that communicates with the front panel and instruments connected to the PC. ·In this case, the instrument connected to the PC is the Propeller microcontroller. ·
·
Figure 1: Front Panel Example
·
On the left, there are a number of serial port settings. ·On the right, notice that there is a control labeled Value to Propeller and an indicator labeled Value from Propeller. ·When you enter an integer into the Value to Propeller control, LabVIEW serially transmits the value to the Propeller. ·The Propeller sends back the negative of the value you entered, and LabVIEW receives and displays this result in the Value from Propeller indicator. ·
·
Figure 2 shows the LabVIEW graphical program (block diagram) that takes care of the communication between the front panel and the Propeller chip. ·If you are viewing the front Panel in Figure 1, you can open the block diagram by clicking the Window menu and selecting Show Block Diagram. ·
·
The program in Figure 2 starts by configuring a VISA serial port resource with values entered into the front panel controls (the ones along the left in Figure 1, including COM port, baud rate, etc.) ·The program then follows the yellow/black (error) and purple (VISA Resource Name = COM Port) lines entering a large gray while loop box. ·Blocks inside the while loop format text and a number from the front panel and send them to the Propeller chip, and receive, format, and display the value that the Propeller chip replied with.· The code inside the while loop repeats until the STOP button control under the Terminate Serial Loop label on the front panel is clicked. ·Then, the program exits the while loop at the bottom and the VISA blocks in the lower-right of Figure 2 close the serial port resource so that the COM port is available to other programs, such as the Propeller Tool software which can then download modified programs to the Propeller chip.
·
Figure 2: VI Block Diagram
·
In a pseudo code nutshell, the VI in Figure 2 executes the following loop:
·
Start the serial port
While Loop
········· Send to serial port: “!v=” followed by 4 bytes that contain the Int32 entered into the front panel’s Value to Propeller control.
········· Get a delay value (default 100 ms) from the front panel and wait for that amount of time.
········· Get 4 byte reply from the serial port, reconstruct them into an Int32, and display it in the front panel’s Value from Propeller field
Repeat while loop if stop button is not pressed; otherwise, exit loop.
Close the serial port
·
A LabVIEW Int32 is a 32-bit integer value, which can be broken apart into 4 8-bit bytes and then transmitted. ·The VI uses a Flatten to String block to convert the front panel Int32 value to 4 serial bytes that can be transmitted via the serial port. ·The Flatten to String block can be configured to transmit bytes using big-endian, native host, or little-endian orders. ·Little-endian means that the bytes are ordered in B0, B1, B2, and B3; whereas, big-endian orders the bytes in B3, B2, B1, and finally B0. ·Native host order depends on your computer.· The native order for the Propeller chip is little-endian, so selecting that option made sense from the Propeller coding standpoint.
·
Figure 3: Flatten to String
·
For values received from the Propeller chip, the unflatten from String block receives 4 bytes in little-endian order from the Propeller and reconstructs them into an Int32, which it sends to the Value from Propeller front panel indicator. ·The Unflatten from String block needs to know if there is any header information (F = false) Boolean input, and the constant on the top is set to Int32 representation, which configures the Unflatten from String block’s output.
·
Figure 4: Unflatten From String
·
The Spin language Propeller application code shown in Figure 5 relies on the v1.2 of the FullDuplexSerialPlus object introduced in the Propeller Education Kit Labs: Fundamentals Chapter 6 to handle the serial communication with the LabVIEW application. ·The application’s repeat loop waits for the “!v=” string using the FullDuplexSerialPlus object’s waitstr method. ·Immediately after the “!v=” string arrives, the application calls the FullDuplexSerialPlus object’s GetLong method, which receives the little-endian order bytes transmitted from LabVIEW and laods them into a long variable. ·It negates this value, and transmits it back to LabVIEW using the FullDuplexSerial object’s PugLong method.
·
Figure 5: Propeller Application Code
Testing the Application
“Exchange Int32 Values with Propeller.vi” is a modified version of smplserl.llb from \LabVIEW\examples\instr that exchanges bidirectional value exchanges between LabVIEW and the Propeller Microcontroller.· As mentioned earlier, the VI transmits an Int32 to the Propeller and then receives the Propeller's response. ··
·
The accompanying Propeller “Exchange Long Values with LabVIEW.spin” application replies with the negative of the number it received from LabVIEW.· The two files working together provide a starting point for a variety of LabVIEW + Propeller microcontroller projects.
·
P······ Download LabVIEW Propeller Number Exchange Code.zip.·
P······ Using the Propeller Tool software to load "Exchange Long Values with LabVIEW.spin" into the Propeller chip.·
P······ Find out which COM port the Propeller chip is connected to by pressing F7 in the Propeller Tool.·
P······ In the VI front panel, set the VISA resource name to the Propeller chip's COM port, and then click the Run button (not Run Continuously, just Run).·
·
The Int32 in the Value to Propeller field gets transmitted to the Propeller chip, and the Propeller Chip replies with the negative of that value, which this panel displays in the Value from Propeller chip field.·
·
P······ Click Window-Show Block Diagram, which will bring up a block diagram similar to the one shown in Figure 2.
P······ Click the block diagram window's Highlight Execution and Retain Wire Values buttons to examine VI program execution.·
P······ Disable those two buttons before stopping the VI's execution (or you will have to wait for it to complete another iteration of the loop).·
P······ Stop the application by clicking the STOP button below the Terminate Serial Loop label in the front panel shown in Figure 6. ·
·
Figure 6
·
When you want to stop the VI's execution, make sure to use the STOP button in the front panel (titled Terminate Serial Loop) instead of the stop button in the button bar under the menus.· The button bar's Stop button does not allow the VI to exit its loop and close the serial port session, which could prevent the Propeller Tool software from being able to load modified programs into the Propeller chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/6/2009 1:04:45 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/6/2009 12:41:22 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/6/2009 12:40:52 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/6/2009 12:41:09 AM GMT
This is good stuff!!
Thanks,
Jim
This is good.
Maybe simulator module to this program!
http://www.labcenter.co.uk/index.cfm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
If you run into this, just flip the Read switch to the Off position before running the VI...
Once it starts, just flip the Read switch to On and it works fine...
Great work, got to look into this later this weekend...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Living on the planet Earth might be expensive but it includes a free trip around the sun every year...
Experience level:
[noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
[noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
[noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
[noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
[noparse][[/noparse] ] I dream in SX28 assembler...
/Bamse
You can get a full copy of LabView to use for one year if you sign up to be an FRC mentor.
The only restriction is to only use it to program the robot you build for the competition.
I plan to learn LabView over the summer and looking into hooking up and interfacing the Propeller or SX to our robot.
FIRST site,
http://www.usfirst.org/involved/content.aspx?id=11358
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Living on the planet Earth might be expensive but it includes a free trip around the sun every year...
Experience level:
[noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
[noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
[noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
[noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
[noparse][[/noparse] ] I dream in SX28 assembler...
/Bamse
I have a problem for communication Labview/propeller. In my VI, if I do not close the VISA session at the end of the Write/read protocol, every thing work fine. But if I close the VISA session, a reset is sent to the propeller. I did not find anything about this on the WWW, or in the labview documentation. Can you help me ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
There is a sytem that costs 0 euros·that·communicates to the propeller·or any other
microcontroller that can do serial comms. Also, with its graphics ability you can create
just as visually pleasing displays.....it is called RobotBASIC (www.RobotBASIC.Com)
If you are not sure how to use·RB's serial I/O abilities make sure you read
http://www.robotbasic.org/resources/RobotBASIC_Serial_IO.pdf
The above document has an example of how to send two numbers to the BS2
which then adds them and sends them back to the PC for display. You can do the
exact same thing with a Propeller but you need to write the Spin code. The code
in RobotBASIC would not need·any modification.
I am still a learner as far as Spin is concened and cannot yet write the Spin code
to do the above (maybe you can do it??). But, I have just purchased the PEK and
once I get over the hump I will be doing a project that demonstrates how to utilize
this GREAT chip along with RobotBASIC to implement·interesting projects.
I think with the multitasking abilities of the Propeller chip and the GUI abilities
of RobotBASIC you can create projects that would be very impressive and yet
cost very little. Morevover, as can be seen from the examples in the PDF above
you can do it with VERY·FEW lines·of code.
www.youtube.com/watch?v=27Gt3IgdcMc
How simple could it be.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 5/21/2009 12:49:17 PM GMT
I am a fan of microcontrollers and robotics. So I have bought the NXT lego system. With this, I have been able to get a free license for labview 7.1 (cost 0 €[noparse];)[/noparse]. So My question's cost (from an economic point of view) is 0/10 = 0€. If every one has a (free) reponse which is really solve my problem, I should be happy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Ole Man Earl was using LabView for his autopilot project
http://forums.parallax.com/showthread.php?p=804939
http://forums.parallax.com/attachment.php?attachmentid=60962
Regards
Gianni
runtime version to run your vi's. I am getting to like Labview more and more.
Earl
RobotBASIC can now do TCP and UDP communications. I have developed two programs that demonstrate how you can control
a robot from one computer over the LAN (or internet) to another.
Check out this Zip file
http://www.robotbasic.org/resources/TCP_Robot.zip
In the zip are 4 files (2 .BASs and 2 EXEs which are the compiled .BASs)
You can run the two EXEs on seperate machines over the LAN (or internet) or on the same machine
for easier testing. It can be quite impressive to see the robot on one PC·moving around as a response
to commands from a totally different PC....but it also looks good with the two programs running on the same PC.
TCP_Robot_Controller.exe is the controller side and is the client end. Once it connects with the server end (robot)
you can control the robot and move it around....read the instructions...you can even get a snap shot.
TCP_Robot.exe is the robot end (server) which will wait for the client to connect and once connected the robot
will respond to commands from the client and will send sensory data back to the client and even a snap shot.
The robot end in the demo is the integrated simulated robot in RobotBASIC.....HOWEVER.....you can implement
A REAL robot with the very same prgrams in two ways:
1- The TCP_Robot program can be modified to control a real robot over a Bluetooth link or RF-serial as Ratronic is currently doing
2- Instead of the TCP_Robot program, you can have a REAL robot with a WiFi TCP board that can be communicated with by the
Propeller and the received commands can be acted upon and the required sensory data sent back all through the onboard WiFi board.
Have a look at the source code...one is 109 lines of code and the other is 87 lines of code...think about these numbers
while you run the programs and try to think what programming languages can do all this in such a small amout of code lines.
Also check out my posting as a reply to another posting on this forum....the program I posted there to help the·poster
might interest you....it took me 1 hour to create....
http://forums.parallax.com/showthread.php?p=809307
Regards
Sam
Can we use LabView to Program directly the propeller without using the SPIN language. Is there any LabVIEW library to be able to pass the functions to the propeller chip?
Thank you,
Othello
No, you would have to program the propeller in spin. Labview is just for showing data sent to and from the prop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
can some one help me to modify the labview number exchange code to hexadecimals, and the out put it through pin 2, and read status and transmit it back to labview.
im trying to control AX-12 motors using propellor from labview.
thank u
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Joy M.A
Mechanical Engineer
I think you can get LabVIEW to accept hex values by right clicking on the "Write To" control box, then select Properties or Display format. Changing the display format shouldn't affect the actual bits and I don't believe the prop will care. To change the output pin to P2, you'll need to edit the spin file. Change this line to the
ser.start(31, 30, 0, 9600) ' Start serial COM object.
The arguments are defined in the FullDuplexSerial object as:
PUB start(rxpin, txpin, mode, baudrate)
So you'll need to change the 31 and 30 to the Pins on which you'd like the comms to take place.
Hope that helps.
Peter
im not sure if u understood me, i guess that the 31 , 30 pin are btwn the propellor and my pc.
i want to output from the propelor the same data but at higher baudrate.
i am using the propellor just to interface my servo with software.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Joy M.A
Mechanical Engineer
Guess I didn't understand you and I'm more confused now.
no mention of baud rate. But if you look at the method definition you'll see that baud rate is the 3rd parameter.
Do you want a labview<->Prop serial link and a second one? If so I recommend you use Timmore's 4 serial ports in one cog object. You can then have one link between a PC running labview and the Prop and a second one between the prop and your device.
If you simply want to up the baud rate between the prop and Labview you'll need to change the 3rd parameter in the start method of the prop serial port and use the drop down menu on labview to match.
Were you able to get the hex part working?
If you need more help can you be very clear about what you need?
p
A Dynamixel instruction packet looks like.
0xFF 0xFF 0x01 0x04 0x03 0x19 0x01 0xDD
The instruction packet above lights the LED on ID 1 and has the following format.
[noparse][[/noparse]start] [noparse][[/noparse]start] [noparse][[/noparse]id] [noparse][[/noparse]length] [noparse][[/noparse]instruction] [noparse][[/noparse]param1] [noparse][[/noparse]param…n] [noparse][[/noparse]checksum]
[noparse][[/noparse]instruction] [noparse][[/noparse]param1] [noparse][[/noparse]param…n] => write [noparse][[/noparse]0x03] starting at register 0x19 the value(s) 0x01.
The write command returns a status packet. The status packet protocol is openly published and looks similar to the instruction packet.
The DynamixelAsmBus object exposes the status packet through the following method
The “GetAxBuffer“ method is wrapped in the high level iDynabus object which sends the status packet back to the caller though FullDuplex Spin.
So jwma all you have to do is send whatever bytes back to LabView that you want. Executing a Dynamixel command is another story. It’s very easy to do though. Simply send a properly formatted Dyanmixel command to the Prop while running iDynabus NOT Dynabus. Dynabus is for stand alone operations as stated in the manual. iDynabus is designed to interface with your PC or microcontrollers like a STAMP. IDynabus takes the properly formatted AX-12 instruction packet and passes it to the AX-12 bus. If a status packet is returned (not all instructions packets have return packets), the status packet is placed in a buffer. You can even use the USB2Dynamixel SDK from Robotis. The SDK comes with a Dynamixel object for LabView.
Don't forget to properly wire the AX-12 network to the propeller - Yeah the schematic is in the manual and source files.
jwma, everything you need is right in front of you. I understand that this kind of stuff can be difficult especially if you don't have a lot of programming experience. You have to start somewhere...
Post Edited (Mike G) : 9/30/2009 5:41:10 AM GMT
sory for my trouble but i have no idea about this buisness, and i have to work it in some way or another to get on with my project.
is there any aplication or code that can interface labview with AX-12 through propellor parallax.if i can get to control my servos from labview i will have no problem from there on. in other words i need a code that can read the data packet i write in labview, then send em to the parallax board, to send em to Ax-12 for execution, and then in the same sequence feed labview back with the data.
i hope that it is not imposible, and there is somthing available that i could use.
thanks in advance
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Joy M.A
Mechanical Engineer
Hi there!
I might doing something wrong but I'm having the same problem described above, but flipping the read switch off doesn't seems to help.
I mean if I switch it off, the VI will start but once I try to read the value by switching on the switch back on, it will fail with error 74 :-(
does anyone have an idea?