I am developing an application where I run a DC motor using MOD 54415. The velocity command to the motor is send using DAC while the velocity feedback is returned through the ADC channel. I write a function which runs the motor (starts the ADC and DAC) and stops it when I want. I want to log the ADC, DAC data when I run the motor.
In the factory example of MOD 54415 I learned that one can setup a ftp server on the netburner and use it to create file and retrieve data using function FTPD_SendFileToClient. After looking at the example the initial scheme i thought of was as follows
- Store data in a memory block when motor is running (I don't intend to run it too long).
- In function FTPD_SendFileToClient access this memory through a function which passes the memory pointer.
- Use this pointer to write data from memory block to a file and transfer the file to my PC.
The problem with this scheme is that I need to call my function which runs the motor through FTPD_SendFileToClient function. So effectively I need to start ftp client on my PC which calls FTPD_SendFileToClient to start or stop my motor.
I would like my motor to run independent of the ftp server functions
hence will it be better if I save my ADC, DAC data in a global variable which can later be accessed by ftp server commands whenever I start the client on my PC? I am having a bit difficulty getting global variables work right now.
Or should I used some shared memory technique to do this so that the ftp server function can access this memory without calling the function to run the motor. What is the way of using shared memory in MOD 54415?
Thanks
MOD 54415 best way to save ADC and DAC data
Re: MOD 54415 best way to save ADC and DAC data
Why not put a microSD card in the module and store the values to a file on a file system? Alternatively, you could put the file in flash or ram. Then you could pick it up via FTP from you PC anytime.
Re: MOD 54415 best way to save ADC and DAC data
You don't mention how much data you need to save, but you have 64MB of fast ram. You could store the data there in a structure array, then only ftp it when requested. If you need more memory than that, the flash card would be the next choice.
Re: MOD 54415 best way to save ADC and DAC data
Thanks. Right now I will be logging less than 2 MB data. So I am using a global structure to store my data . The ftp functions then access the data structure when I execute the ftp functions. I was curious about what are the shared memory options in netburner if I don't want to use global variables and also don't want to pass variables through functions.