Data Logging with a MMC/SD card

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Please rate this article out of 5: (1 being the worst and 5 being the best)

1
0
No votes
2
0
No votes
3
0
No votes
4
0
No votes
5
5
100%
 
Total votes: 5

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Data Logging with a MMC/SD card

Post by Benj »

Hello Achillis
When you are saying to use the USB serial you mean to plug a USB cord(Btype) to the ECIO and the other end would be D-type(RS 232) DB9? And on the D-type after I will attach the MAX232 in order to convert the signal and then connect it to the PC?
Only do this if the RFID device is a long way from the monitoring computer. You can use the USB Serial component directly on your ECIO RFID device and this would allow for direct data access without messing about with level shifting etc.
Can I just use the USB HID in order to send commands(as in the form of bytes or characters) through a USB cable to a PC?
I would recommend the USB Serial or the USB Slave. The USB HID device can be a little tricky especially when designing custom HID descriptors.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: Data Logging with a MMC/SD card

Post by achillis1 »

Hello Ben,

Thank you for the help.
Given the reason that I am not to familiar with programming I am confused regarding the ECIO/PC comms. The software engineer will write a software that will be used to read the values on the MMC card and also whatever will be printed on the attached LCD screen. So how he will achieve that? By telling the software to "listen" for incoming bytes or strings on the USB port of the PC ? How it will address the ECIO?
When I will want to send data to the ECIO I will send bytes or strings to the USB port? Then in order for the ECIO to get the data from the PC, I will have to have component macros all over the ECIO's flowchart that will say: readByte or readString?

Example: if I want ro read something from the MMc card, then I will perform a read command from the custom component macro, in order to read a value and then assign the value to a variable and so on I will call the USB component macro and send that variable through the command SendByte? Will the software on the PC be able to read it like that?

I am kind of lost here!
I do not know if I was clear please say so!

Thank you,

Best Regards,
Achillis

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Data Logging with a MMC/SD card

Post by Benj »

Hello Achillis

When I say USB serial I mean USB type B (ECIO) to USB type A (PC). The serial portion of it is based on the USB drivers that configure a virtual COM port that allows you to send and receive bytes from the ECIO as and when they are required.

From the PC side of things if you use the USB Serial then you reference the device via a COM port. The COM port will be connected when you connect the device. If you use the USB slave then the PC initiates all transactions and uses a DLL to address the device.

Working examples including PC example code can be found in the main USBpack download.
http://www.matrixmultimedia.com/FlowcodeUSBPack.php

Its probably worth going through the examples and seeing which one will better suit your application and your software engineer.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: Data Logging with a MMC/SD card

Post by achillis1 »

Hello Ben,

I was trying the following : filename = "Log"
filename = filename + ToString(filenumber)
filename = filename + ".csv"

insude a "string manipulation" icon and an error pops out saying that I have undefined variables and "one or more of the string manipulation lines are invalid". I choose all the variables from the variable list so it is not possible to have one that is undefined.
If I state filename=ToString(filenumber) then it is ok!

Thank you.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Data Logging with a MMC/SD card

Post by Benj »

Hello

The problem is this line.

filename = filename + ToString(filenumber)

It is doing a function and an addition which Flowcode is unable to handle.

Try the following and it should work correctly.

filename = ToString(filenumber)
filename = "Log" + filename
filename = filename + ".csv"

Post Reply