Components

cancel
Showing results for 
Search instead for 
Did you mean: 

CompactRIO Waveform Library

Hi,

 

unfortunately I am not able to edit my previous post above.

It's working with the NI 9227, so just forget my question. 🙂 I am a newbie to cRIO / LV and just forgot to call the module's Start I/O node. 😕

 

 

0 Kudos
Message 81 of 115
(6,458 Views)

Hello Waveform Reference Designers//Users,

 

I have used the reference design library on a couple of past projects quite successfully. Recently, I have been involved in developing a cRIO based DAQ application, using the new Linux RIO 9068. I was interested in using the waveform reference library, and began a basic test setup to monitor 40 dynamic strain channels (NI 9236). I used the DSA FPGA template, and the example project RT code installed to LabVIEW 2013 SP1 from VIPM (Library Version 4.1.0.9). 

 

When running the application the first time, I was monitoring the RT "front panel" in the development environment. Almost immediately, the cRIO disconnected from the system, as if you over ran the processor or memory. I did some further investigation, and could not find any obvious issues. Repeatedly tried rebooting the cRIO and running the code, and faced the same issue every time the code ran. 

 

I grabbed a USB Serial device, plugged into the cRIO COM port. Validated the system boots correctly, and again tried to run my sample code. The problem was immediately apparent:

 

lvrt: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &(                                   (av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) &&                                    old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_o                                   ffsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2                                    * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_en                                   d & pagemask) == 0)' failed.

 

The cRIO RT OS was crashing. Only a reboot allows LabVIEW to reconnect, and re-deploy code. On subsequent runs, while typically getting the malloc error, I occasionally got: 

 

LabVIEW caught fatal signal
13.0.1 - Received SIGSEGV
Reason: invalid permissions for mapped object
Attempt to reference address: 0x0x41c60000

 

After a number of attempts with diagram disabling different aspects of the library, I was unable to resolve the issue. I opened and NI Service Request #7416529, only to find that after escalation R&D deemed this unsupportable because of the use of the Waveform Reference Library. They also indicated no one has seen anything like this before, ever. I am posting here, as I am wondering if anyone in the community has used the design with the new 9068 cRIO. I also wanted to make people aware that this can happen.

 

I have since abandoned the reference library, and constructed my own custom application. I have not yet experienced issues with my own code. Perhaps the curators of this design know a bit more about what can cause this behavior, or get their R&D guys to take it a bit more seriously. 

 

I guess I leave this community as I was left with my support request, "Good Luck."

 

~Pcorcs
0 Kudos
Message 82 of 115
(6,434 Views)

Hello All, 

 

As a quick follow up, not to leave my previous message completely open ended, I have posted a sample application that includes the offending code.

 

Here is the RT Test VI, configured for a continuous acquisition:

RTVI.PNG

 

I have also attached the sample project I created for my Service Request. All source code can be found in the attached zip, below. 

~Pcorcs
0 Kudos
Message 83 of 115
(6,406 Views)

Pcorcs,

 

1.  What USB Serial device did you plug in?  Are you trying to use a USB DAQ device with this library?  It is for use for DAQ from the FPGA.

 

2.  What sample rate are you using?  Is it some value not allowed (or too high) by the modules you are using?

 

3.  Your example looks fairly straight forward.  I have a much more complicated example based on the Vibration Data Logger sample project, and also using the 9068.  It is working with no strange issues like you are seeing.

 

Neville.

0 Kudos
Message 84 of 115
(6,391 Views)

Hi, 

 

1. USB-Serial converter is connected to the 9068 serially (RS-232) to allow me to view the cRIO console on my PC. I have no USB connections to the 9068.

 

a. No, I am not using any sort of USB DAQ. I am using a slightly modified version of the Reference Design Library Template for FPGA and DSA Modules. (As you will note by downloading and opening my example LV Project) . I am well aware of what this library is used for...USB is only mentioned for how I was able to detect the malloc error through the system console. Web based console was not possible due to the crash.

 

2. Sample Rate is set based on the capability of the DSA module. For my tests, I experienced crashes throughout the range. The lowest tested was ~786 S/s, to 10k S/s. These values are defined by the Module. The Reference Library offers and 'Auto" timing function to coerce to acceptable rates. (Again,  it is in the example project posted).

 

3. Lucky you! That seems to be a common theme, in that those that viewed this form the NI Support team also indicated that no one has ever seen these problems. I assure you I am not fabricating this issue. 

 

Cheers, 

 

 

~Pcorcs
0 Kudos
Message 85 of 115
(6,384 Views)

Have you tried:

1   re-installing all software components on the 9068

2  deleting the waveform library from your PC and re-downloading the packages

3  recompiling the fpga code

4  upgrading to LV 2014

 

My setup was LV 2013 SP1, but I have recently upgraded to LV 2014.

 

 

I don't have hardware available right now to try your code.

 

5  How is your code different frm the waveform library?

6  Does the crash happen outside the loop during initialization, or inside the loop.  

7  Is it the first loop iteration or subsequently?

8  Have tried a mode other than continuous acquisition?

9  Have you tried Ctrl+Shift+RUN Arrow (to force a re-compile of your VI's) & then a save.

 

Neville.

0 Kudos
Message 86 of 115
(6,380 Views)

Have you tried:

1   re-installing all software components on the 9068

- Yes, formatting and reinstalling core software on the cRIO, did not resolve the error.

 

2  deleting the waveform library from your PC and re-downloading the packages

Yes, interesting you ask this. During my initial development and run in with this issue, I discovered that 2 versions of the reference library were installed on my 2013 SP1 instance, the newer one in \Addons and the older one in \UserLib. I removed both, and reinstalled the latest from VIPM. Perhaps I didn't get everything and we have some sort of cross linking? I get no warnings in the project, as you will see if you get a chance to open it. 

 

3  recompiling the fpga code

Yes, multiple re-compiles (non-trivial amount of time). No change in behavior. 

 

4  upgrading to LV 2014

No. May be possible; however, as an allinace partner we usually wait for the platform DVD to sail the Atlantic to avoid downloading all individual pieces, and making installer builds nightmarish. We probably won't have this in hand for another month or so. 

 

5  How is your code different frm the waveform library?

- The example shown has edits to the FPGA adding additional piplining to support channel calibration and feedback on an output module. The FIFO remains undisturbed other than the number of channels in the array has been modified to accomodate my channel count. 

 

6  Does the crash happen outside the loop during initialization, or inside the loop.  

- Isolated this to inside the loop. I tried also disabling various things inside the Read VI (1D Array of Waveform). I started with the attributes settings, thinking that was the most dynamically challenging for RT. My attempts to disable were unsuccessful. 

 

7  Is it the first loop iteration or subsequently?

- Often first iteration. I have on occasion returned one buffer of data, then crash.

 

8  Have tried a mode other than continuous acquisition?

- No.

 

9  Have you tried Ctrl+Shift+RUN Arrow (to force a re-compile of your VI's) & then a save.

Yes, have force recompiled, no change in behavior.

 

 

As this project is for a client and on a schedule, I have since abandoned the reference library in favor of custom VIs that very closely mimic the structure of the library design pattern. So far, with no references to the library VIs, I have not been able to replicate this malloc error. Your point about the versions/reinstall of the library is a good one, perhaps I have bricked my LabVIEW instance with respect the reference library. 

 

All this aside, no matter how bad of a customer I am :), one should never encounter malloc errors. I felt that was note worthy for NI if for nothing else than making things more bullet proof.

 

Thanks for taking interest.

~Pcorcs
0 Kudos
Message 87 of 115
(6,366 Views)

The fact that your code is very similar to the Waveform library and it works, points to some corruption in your version of the waveform library.

 

N.

0 Kudos
Message 88 of 115
(6,355 Views)

Hi,

 

Is it possible to use or adapt this library when using both SAR and Delta-Sigma modules at the same time?

 

Regards,

Pedro

0 Kudos
Message 89 of 115
(6,296 Views)

It's fully possible to use this with mixed SAR and DeltaSigma modules.

Just use separate I/O-nodes for each type and mix the readings into the same FXP-array. I believe there is a couple of examples that shows this somewhere at NI's web (or maybe in the LabVIEW examples)

EDIT:  beware of the phase offset introduced by the DeltaSigma modules though. You probably have to delay the SAR readings if your application needs tight syncronization between all channels.

0 Kudos
Message 90 of 115
(6,288 Views)