Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Mon Nov 20, 2017 12:50 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: G72 - USB
PostPosted: Mon Dec 02, 2013 3:09 am 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
Hi I am working with your terminal G72 and it provides a USB ports at the back of the terminal.

I supposed that it is possible to connect a USB device and use it for saving or reading data information.

But I dont know to do. How I can read a USB file ?? What file extension has to be this file ??

I would like to connect a USB device and draw a button in my application to read a file and extract an array of paramenters for my application. I have many textboxes and I would like to complete their texts with an array from USB device.

Please give me instructions, example of codes... I have reading your tutorials and programs manual but I can not find nothing about it. May I dont know search it.

Hope to reply me doubt.
Thanks a lot.


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Mon Dec 02, 2013 7:52 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
The USB on a G72 can be used to read and write files from a FAT or FAT32 formatted USB thumb drive.

The drive, when attached, will appear mounted in the folder \usb1\. I recommend creating a workspace with a FileBrowserV2 object to experiment with. The files can be read and written with the standard file system APIs, such as OpenFile, ReadFile, WriteFile, CloseFile, etc. Or with any of the standard objects that interact with the file system.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Mon Dec 02, 2013 8:14 am 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
Could you help me with some code example ??
I need to view some examples to try it.

As I wrote you before I would like to connect a USB device and read an array data from this.

To simulate with Qlarity software I need to change or need an special setup??

Thanks


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Mon Dec 02, 2013 11:17 am 
Offline

Joined: Tue Nov 12, 2013 10:56 am
Posts: 3
Roberto,

I've attached a sample Qlarity workspace file which demonstrates most of the basic USB file read and write file functions. Let me know if we can be of any further assistance.


Attachments:
saveloaddatausb.qly [9.13 KiB]
Downloaded 671 times

_________________
John Raynes
Senior Field Applications Engineer
Beijer Electronics, Inc.
john.raynes@beijerinc.com
Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Mon Dec 02, 2013 1:29 pm 
Offline

Joined: Tue Nov 12, 2013 10:56 am
Posts: 3
In the above (attached) Qlarity example, files created in simulation mode will be read and written just like would happen on the USB stick, but the actual file content will not be persisted to your PC hard disk. The files will disappear when you close the workspace. If you are interested in persisting your simulation mode files to the PC disk, let me know and I can step you through the process.

_________________
John Raynes
Senior Field Applications Engineer
Beijer Electronics, Inc.
john.raynes@beijerinc.com


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Wed Dec 04, 2013 4:00 am 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
Hi,

I've downloaded your attached workspace and I can find all functions to do it.

But component FILEBROWSER_1 only shows SIM folder and I cant search or find my usb.

I try to explain my actions to detect my possible error or failures:
1) I introduce my USB device into PC port:
- Simulation setting: 9600, 8n1, none, com1
In my usb devide I have a .txt file named as "Parametros.txt"

2) Then I simulate the application with Qlarity > Simulation View.
3) After some seconds (I supposed due to timer "CheckUSBtmr") all buttons for READ and WRITE on USB are enabled.
4) I try to search in FILEBROWSER my usb file but is not possible, It only shows SIM folder with "SomeFile.txt"

What I am doing bad ?? Please try to help me and give me instructions to solve it.

Best regards


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Wed Dec 04, 2013 8:15 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
One thing that we may have explained poorly --

There is no direct simulation of USB flash memory devices for PC Sim view. The closest thing we have to that type of simulation is the sim: folder. The sim: folder maps to a folder on your hard drive. Under Windows 7 it should map to c:\users\<username>\appdata\local\Qlarity Foundry 2.63\simfiles. If you write your code to use \sim:\ in Simulation View and \usb1\ on a panel (see the example for how to do that) you can test most of your code on your PC.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Wed Dec 04, 2013 8:38 am 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
Sorry, I am looking for the sim folder but I can not find it.

I have windows xp in my pc.

I search on: C:\Archivos de programa\QSI Corporation\Qlarity Foundry 2.60\SimFiles

But in this case I did not find file "somefile.txt"

Where is it ??


Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Wed Dec 04, 2013 9:34 am 
Offline

Joined: Tue Nov 12, 2013 10:56 am
Posts: 3
Actually the place you will find the files depends upon which operating system that you are running on.

For Win7:
users\<username>\appdata\Local\qlarity2\runtime\simfiles

For WinXP:
Documents and Settings\<username>\Local Settings\Application Data\qlarity2\runtime\simfiles

Remember to also change the file spec variable in the filename declaration. In the example that we previously posted, the filename variable would be modified as shown in the attached file. With the filename as originally declared in that example, the program-generated file will only appear during simulation but will not persist to disk.


Attachments:
usbfileops_simdirspec.png
usbfileops_simdirspec.png [ 53.78 KiB | Viewed 4249 times ]

_________________
John Raynes
Senior Field Applications Engineer
Beijer Electronics, Inc.
john.raynes@beijerinc.com
Top
 Profile  
 
 Post subject: Re: G72 - USB
PostPosted: Wed Dec 04, 2013 10:25 am 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
Ok.

I've change this directory as you said and everything is right !!!
My problems are solved !!!
Thanks a lot


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group