0

How is the DataReader block supposed to be configured to read in float data? I have used a sig_source and the DataWriter block to successfully write to a file. Since I cannot find a description of the DataReader block, my expectation is that it would then be able to read a file generated by the DataWriter block. However, when I attempt to read the file I do not see any data generated. Here is the procedure I followed:

  1. Start DataWriter
  2. Start sig_source
  3. Verify output to file (Result = SUCCESS)
  4. Turn everything off
  5. Start DataReader (pointing to file created by DataWriter)
  6. Monitor output port (Result = No data present)

I have also tried attaching a block to the output of the DataReader in case RedHawk requires a sink before data flows from a source. This did not work either.

EDIT: I performed an additional experiment to test determine if the DataReader loop parameter was in fact the issue. In this experiment I connected the DataReader (pointing to the original file) to a DataWriter (pointing to a new file). The component properties for both blocks were per Youssef's post. I was expecting this to generate a copy of the file. The results were strange. The new file was only 65536 bytes while the original was much larger. It does appear to match on those 65536 bytes. Further, if I delete the new file and try to rerun the blocks there is no output (i.e. the file is not created again). In order to generate the new file a second time, I have to delete the DataReader block from the Chalkboard and reload it.

2 Answers2

0

I'm not sure what version of REDHAWK you are running but I recently tested both the DataReader and DataWriter components from the 1.8.4 and 1.9.0 releases of the REDHAWK core, IDE, & Basic Components. Here was my setup:

Waveform 1:

  • SigGen with default settings, python implementation

  • DataConverter with default settings (Needed as SigGen outputs Real doubles and data Writer takes in floats)

  • DataWriter with default settings & the filename set.

I launched and started that waveform and confirmed the file was written.

Waveform 2:

  • DataReader with the following settings:
    • complex: false
    • InputFile: My file location
    • loop: true
    • play: true

All other settings were left at default

I launched Waveform 2, started the waveform and confirmed data was flowing by plotting the output of the port.

In general, here are a couple things to look out for when using DataReader.

  1. Setting the loop property to true. It's possible playback may be occurring too quickly. Note that the loop property is an execparam ie. it must be set when the component's process is started so it cannot be set after a waveform is launched or within the IDE Sandbox. It must be set when designing the waveform.

  2. If you are using a v1.8 IDE, try plotting the output rather than using port monitor as a second form of confirming data flow. If you are using a v1.9 IDE, the datalist tool would be ideal for this situation. Do a 100 point capture or continuous capture and it will sit on the port until data points have been pushed out the port and the target number of points have been collected or the user has pressed stop.

  3. Don't forget to set DataReader's play property to true and make sure that the complex property is set correctly. I believe complex defaults to true and play defaults to false.

Let us know if you continue to have issues.

Youssef Bagoulla
  • 1,229
  • 1
  • 7
  • 16
  • Thank you for the response. I added some follow up information to my post. I don't believe it is the loop parameter and that was really the only difference in our tests. – user2988280 Nov 21 '13 at 13:56
0

Only 64K of data is being sent by the DataReader, as it thinks that it found an EOF after its first pushPacket, which appears to be a bug in the DataReader.

To send a file that is greater than 64K, you can make a quick code change to get things working. In the DataReader.py file ($SDROOT/dom/components/DataReader/python/DataReader.py). Locate (line 44?):

self.EOF = True

in the DataReader_i.initialize() method. This should be:

self.EOF = False
DrewC
  • 168
  • 5