Tan_godo Posted January 19, 2011 Report Share Posted January 19, 2011 Hi there , Currently we use Atmel programmer i.e sam-ba v2.9 for downloading the bin file into the microcontroller using USB-JTAG (Jlink ). I require to do the same using Labview . The dll is available for the same . I registered the dll successfully and using function "Automation open" the methods under it are available . But i am unable to use the methods successfully . for e.g the method Scan requires input as a pointer to a table where the list of devices are located , the data type of the input is U8 , so if i input a value of 0 , it gives me an error .. Can anybody help , how can we pass pointers in Labview The example code snippet given for the method in the manual is as given below, CHAR *strConnectedDevices[5]; for (UINT i=0; i<5; i++) strConnectedDevices = (CHAR *)malloc(100); AT91Boot_Scan((char *)strConnectedDevices); Please help .... Tan P.s attaching the library files Library.zip Quote Link to comment
ShaunR Posted January 19, 2011 Report Share Posted January 19, 2011 (edited) Hi there , Currently we use Atmel programmer i.e sam-ba v2.9 for downloading the bin file into the microcontroller using USB-JTAG (Jlink ). I require to do the same using Labview . The dll is available for the same . I registered the dll successfully and using function "Automation open" the methods under it are available . But i am unable to use the methods successfully . for e.g the method Scan requires input as a pointer to a table where the list of devices are located , the data type of the input is U8 , so if i input a value of 0 , it gives me an error .. Can anybody help , how can we pass pointers in Labview The example code snippet given for the method in the manual is as given below, CHAR *strConnectedDevices[5]; for (UINT i=0; i<5; i++) strConnectedDevices = (CHAR *)malloc(100); AT91Boot_Scan((char *)strConnectedDevices); Please help .... Tan P.s attaching the library files The char * is simply a C string and it's unfortunate you are using an activeX component since you you can pass that to and from a dll with the string type drop down selection in a code library node. An array of strings is a different matter since there is only a selector for an array of numeric types and although you can de-reference the pointer; you don't know how long the string is in each element (unless they are fixed length) Dereferencing pointefrom C/C++ in LabVIEW is is a fantastic article with execelent examples for many data types. The VI you will need is the Xnode GetValueByPoionter. However, Moveblock Edited January 19, 2011 by ShaunR Quote Link to comment
dannyt Posted January 19, 2011 Report Share Posted January 19, 2011 Hi, Not sure this will be any help but here goes ...... you do not say what device you are downloading to, I had to automate a software download via USB link to a Atmel AT89C5131 the developers were using the Atmel Flip tool to to this manually. The Atmel Flip tool came with a dll and after failing to get it working with LabVIEW for a while I found it also had hidden away a command line batch tool, that did the job with very little hassle as it was a straight forward interface. Dannyt Quote Link to comment
Tan_godo Posted January 20, 2011 Author Report Share Posted January 20, 2011 Hi , i tried using Call libary function . "AT91_BOOT.dll" has only functions register dll , unregister , get object class and unload . But in the libary folder there is another dll i.e. " JLINK ARM.dll " , so basically the boot dll uses this to scan for the devices connected to the PC. Under this there are lots of functions available so basically one will have to use combination of them to try to get some result (rite now schedules are very tight ) So what i was thinking is since AT91_BOOT.DLL is the top wrapper , we should be able to access and get some result out of this only . Checking out Xnode Tan Hi, Not sure this will be any help but here goes ...... you do not say what device you are downloading to, I had to automate a software download via USB link to a Atmel AT89C5131 the developers were using the Atmel Flip tool to to this manually. The Atmel Flip tool came with a dll and after failing to get it working with LabVIEW for a while I found it also had hidden away a command line batch tool, that did the job with very little hassle as it was a straight forward interface. Dannyt I am downloading to an Atmel microprocessor ....... using USB - JTAG link ........ i think this too has some comand line interface .. i'll chk that out some hope there Quote Link to comment
Tan_godo Posted January 20, 2011 Author Report Share Posted January 20, 2011 Hi , i tried using Call libary function . "AT91_BOOT.dll" has only functions register dll , unregister , get object class and unload . But in the libary folder there is another dll i.e. " JLINK ARM.dll " , so basically the boot dll uses this to scan for the devices connected to the PC. Under this there are lots of functions available so basically one will have to use combination of them to try to get some result (rite now schedules are very tight ) So what i was thinking is since AT91_BOOT.DLL is the top wrapper , we should be able to access and get some result out of this only . Checking out Xnode Tan I am downloading to an Atmel microprocessor ....... using USB - JTAG link ........ i think this too has some comand line interface .. i'll chk that out some hope there The programmer has only DLL and TCL Interface ... Quote Link to comment
dannyt Posted January 20, 2011 Report Share Posted January 20, 2011 The programmer has only DLL and TCL Interface ... Yep but look at section 2.51 of the manual........ you can autosave a tcl script and then used that script you just saved to automate your manual steps. I would take a serious look at this method if it was me ---------------------------------- SAM-BA Users guide 2.5.1 Rapid Script Generation A very simple way to record a script file is to launch SAM-BA in GUI mode, and use the ScriptFile menu. Start the recording on script, and then, every action done in the GUI (changing a value in the Memory Display area, executing a script in a Memory Download window, or sending/receiving file) is recorded in the historyCommand.tcl file. This file can be used as is when launching SAM-BA in command line mode. It can also be used as a starting point to elaborate longer scripts. This mode is very useful for automating memory programming. Quote Link to comment
Tan_godo Posted January 20, 2011 Author Report Share Posted January 20, 2011 Yep but look at section 2.51 of the manual........ you can autosave a tcl script and then used that script you just saved to automate your manual steps. I would take a serious look at this method if it was me ---------------------------------- SAM-BA Users guide 2.5.1 Rapid Script Generation A very simple way to record a script file is to launch SAM-BA in GUI mode, and use the ScriptFile menu. Start the recording on script, and then, every action done in the GUI (changing a value in the Memory Display area, executing a script in a Memory Download window, or sending/receiving file) is recorded in the historyCommand.tcl file. This file can be used as is when launching SAM-BA in command line mode. It can also be used as a starting point to elaborate longer scripts. This mode is very useful for automating memory programming. Yup using TCL interface is better compared to dll interface . I will go thru "Rapid Script Generation" section . Currently using TCL84.dll and doing some initialisation on the same i was able to at least able to obtain an ouput for TCL_Scan script . Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.