Jump to content

Tim_S

Members
  • Posts

    873
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by Tim_S

  1. Hadn't thought of using a FIR filter.  :thumbup1:  I bench marked a mean method and your FIR method. The FIR method was ~8-9x faster on my system than the mean with standard for loop, and the FIR was ~2-3x faster with the mean method for loop set for parallelism.

  2. Something is turning the bit off. My recommendation is to look into what is turning the bit off. It could be you're writing a zero to the register incorrectly. It could be the torque tool turns off the bit on its own (I've seen this with drives where external communication is used to set internal bits and both bits are named the same). Are there any "keep alive" signals that need to be sent?

  3. The Arduino, by itself, is pretty good. I found the Arduino kit + manuals to be about the equivalent of the old Radio Shack kits (do they still sell those?). Most of the how-to/tutorials on the Arduino website look to be at the same level.

     

    The LabVIEW student edition, by itself, is available at Studica (http://www.studica.com). I believe you're supposed to be a student to order from that site where as I don't see the same restriction at SparkFun.

  4. I cannot agree with you there as you missed out the fact that the code needs to be maintainable and by maintainable I mean by any programmer of a suitable experience level, not just the person who wrote.

    The customers I've worked with (mainly automotive) want a system that has a green light for a good part, a red light for a bad part, and the part-to-part must be under the cycle time. The metrics of performance are on-time and under budget. The code should always be maintainable as this will always help out the next person to look at the code (even if that person is the one who wrote it in the first place), but being the last pole to go up in the tent forces trade-offs that can include breaking-even on a project.

  5. hooovahh has a good example. I think you'll need to monitor state between loop iterations as well. For example, the integration would start when the digital goes high in one read of your data and then continue into the next read until the digital goes low in a read N iterations later. You'll need a shift register to hold the state (don't forget to initialize the shift register), which might be as simple as a boolean for this. If you need more than two state (integrate/don't integrate), then my preference would be to use an enum made into a type def.

  6. OK, the way you've set up the data acquisition it will use the sample clock from the analog input to also acquire the digital input. In other words, a digital input sample will be taken every time and at the same time that an analog input sample is taken. You've also started the digital and analog input tasks such that the two will start together. This means the analog input and digital input are synchronized in time (e.g., the 1000th sample taken for the analog input was taken at the same time as the 1000th sample of the digital input -- this is the array index referenced).

     

    This is all good as it makes what you're looking to do easier.

     

    Looking at your code, are you looking to perform the integration on "live" data (as you collect it) or are you going to post-process the data (after you've collected all the data)? I would recommend something different for live versus post-processing.

  7. Are you having trouble finding the array index where the transition occurs or the timestamp of that index?

     

    If the array index for the transition, a search 1D array for a true/false would give you the index. You 'd need to use the results for the search for the true as the start index for the false.

     

    For finding the timestamp... If the analog and digital data acquisitions are synchronized, you don't need to find the timestamp; just use the index. If the data acquisitions are not synchonized, then the timestamp would be the (index * dt) + t0, and then (timestamp - t0) / dt on the analog side to get back to an index.

  8. It depend on the intent of the interface. Configuration, applications with multiple windows, etc., get a File->Exit in the menu. My applications that run as services have a icon in the system tray that can be right-clicked to exit the application, but any pop-ups have a close only. One application that is intended to fill the window and does not have a title bar or menu does have a "computer power" icon in the lower corner that is used to shut down.

  9. I've found the manuals for the Modbus addresses to be invariably wrong (I've even had a technical rep tell me this). The addresses may be correct internally, but externally they can be 1 or 2 addresses different from the published. I also have run into the address published needed x40000 added to it to work. I recommend contacting the equipment supplier and picking their brains about how their product works, and prepare to search around on your own. A little routine that checks for a known input pattern (e.g., bits 0, 2 and 3 are on and the rest are off) can help hunt-and-peck the correct address out.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.