Discussion:
Read Binary File To LABVIEW Matrix
(too old to reply)
057768022
2005-08-25 11:42:42 UTC
Permalink
Hi,
 
I have created a binary file in MATLAB with 'schar' format which can be read in c.
I would like to read the data to LABVIEW MATRIX for generating pattern output using
PCI 6534 device and external clock as trigger.
 
Please explain how to read the file to LABVIEW.
 
Thanks.
ChrisJ
2005-08-26 20:14:08 UTC
Permalink
Hi,
 
Well you need to know how Matlab is storing the data. After that everything should be fairly easy. Use the File I/O VIs to open the file, read the data, and then close the file. Remember to specify the data type (byte stream type) on the Read File VI. If you can't get that to work, post some very simple example code for generating an schar array in Matlab and an example of the type of file you would like to read.
 
Regards,
Chris J
057768022
2005-08-28 12:11:17 UTC
Permalink
Hi Chris,

I decided to read the data from *txt file to LABVIEW variable. (After loading I will write the data to DIO in real time periodically).
I would like to write data burst to a device using PCI 6534 , I added my application.

1.      Is it preferred to use pattern IQ generation or burst transfer mode?

2.      Can you send me an example which is related to this application.
 
Best Regards,
Nir


Burst_PattIO.doc:
http://forums.ni.com/attachments/ni/70/3562/1/Burst_PattIO.doc
Hal L
2005-08-29 22:42:56 UTC
Permalink
Hi,
 
I recommend using Pattern IO for your application.  I am attaching an example which should help get you started.  The example will read data from a binary file and output this data on digital lines for the 653x series boards. I hope you find the example helpful. 
 
Regards,
Hal L.


Pattern_Output_from_Binary_File_(finite)[1]daqmx.vi:
http://forums.ni.com/attachments/ni/70/3567/1/Pattern_Output_from_Binary_File_(finite)[1]daqmx.vi
057768022
2005-08-31 14:13:25 UTC
Permalink
Hi,
In my application the write should be triggered with external clk (84 kHz) and in sync with external clk 4.2 MHz signal.
Upon each trigger clk the PCI should write one 50 bits data burst, which are in sync with the external 4.2 MHz clk.
Is is possible with Pattern I/O?
(Your application uses internal port)
Can you update the above *.vi for the requested system?
Best Regards,
Nir
057768022
2005-09-04 06:41:18 UTC
Permalink
Hi,
 
My application is SSI Out. (Serial Sync. Interface , "Write").
I have 3 digital lines.
1. CLK - 4.2 MHz  (Is given From External Device)
2. SYNC - 84 kHz (Is given From External Device) 
3. Data - Generated form file. (Is loaded from file *.txt to LABVIEW variable)
 
Upon each SYNC burst of 50 bits should be transfered (On Data line) from PCI 6534 to an external device.
The CLK is for synchronizing the data.
 
Is "Parallel output with external triggering" is suitable?
1. The CLK form the external device is connected to REQ line.
2. The SYNC serves as burst trigger, and connected to ACK1 (STARTTRIG1) line.
 
Best Regards,
Nir 
Hal L
2005-09-06 23:13:28 UTC
Permalink
Hi,
Using parallel mode along with retriggered finite digital output will work for your application.  I am attaching another example which should help get you started with this.  You should be able to take this example and make the necessary modifications to fit your specific application.  I hope that you find it helpful.
Regards,
Hal L.


Write Dig Chan-Int Clk-Dig Start Retrig.vi:
http://forums.ni.com/attachments/ni/70/3621/1/Write Dig Chan-Int Clk-Dig Start Retrig.vi
057768022
2005-09-15 15:13:31 UTC
Permalink
Hi,
I am still trying to write my data using external CLK and CLK trigger.
I had real time problems, (I need that every trigger, different sample will be written).
I changed my VI to the added one.
And I am getting the following error:
Error -200462 occurred at DAQmx Start Task.vi
Possible reason(s):
Generation cannot be started, because the output buffer is empty. 
Before starting a buffered generation, write data. Unreserving a task empties the buffer. Changing the size of the buffer or setting the Regeneration Mode property will result in the buffer being unreserved and emptied.
 
What can be done?
 
Best Regards,
Nir
 


6543mxFinGenNonRegDaqmx.llb:
http://forums.ni.com/attachments/ni/70/3672/1/6543mxFinGenNonRegDaqmx.llb
057768022
2005-09-18 09:12:45 UTC
Permalink
Hi Hal,
Thank you for your replay.
I have made the above modifications. I still can't write the data from the file.
I am getting the following error at the second "Write",
---------------------------------------------------------------------------------------------Error Remark------------------------------------------------------------------------------------------------------
Attempted to write a sample beyond the final sample generated. The generation has stopped, therefore the sample specified by the combination of position and offset will never be available.
Specify a position and offset which selects a sample up to, but not beyond, the final sample generated. The final sample generated can be determined by querying the total samples generated after a generation has stopped.
Attempted to Write Sample: 48
Property: RelativeToCorresponding Value: Current Write Position
I added my application. ( The sub vi's are in the previous post)
Best Regards,
Nir
 


WriteOnly18_9.vi:
http://forums.ni.com/attachments/ni/70/3687/1/WriteOnly18_9.vi
Hal L
2005-09-19 23:13:16 UTC
Permalink
Hi Nir,
I'm looking into your issue right now.  It may not be possible to trigger off of an 84khz clock in software. I apologize for saying that would work, but I did not originally think that your external clock would be at that high of a rate.  I will post another reply when I have more information.  Thank you for your patience on this issue.
Regards,
Hal L.
mandar
2007-05-03 07:10:10 UTC
Permalink
HI,i'm using PCI 6534 Card .i want to read the serial data on the external clock i
have used DAQ MAX but i am unable to read from external clock as input
to read serial data instead of that im using
/Dev1/Dig0/SampleClockTimebase AS a clock source but i'm not sure that
reads at it's +ve edge(rising) since i want to use external clock
source please tell me how to proceed for this applicationplease reply memandar(see attachment)


read.vi:
http://forums.ni.com/attachments/ni/70/6801/1/read.vi

Loading...