Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/02/2017 in all areas

  1. I've re-built the package with VIPM 2014:
    1 point
  2. ^^ Yeah, I can tell you from personal experience that actually trying to use the 3.5 char of silence is not a great idea. You do need a read timeout and polling, but you should parse the packet as you read it to determine how long its supposed to be, and then check the crc. As mentioned above, the serial software stack you're going through (labview->visa->os) is not conducive to waiting for silence. The packet should be parseable and if you just keep in mind that a modbus packet is limited to a pretty tiny maximum size, there are a lot of checks you can do to eliminate issues and basically "close the connection" if a problem is encountered. The issue with that is that both master and slave need to back off appropriately, clear buffers, etc, to make sure that any communication error can be resolved without rebooting the system on either side.
    1 point
  3. When you break down your string into different sub-sections, the problem becomes much easier to solve. Don't try to handle 4 delimiters at the same time. The format for the full packet is: !<VOLTAGE_LIST>:<TIMER_LIST><CR> The format for <VOLTAGE_LIST> is: <VOLTAGE_PAIR[0]>;<VOLTAGE_PAIR[1]>;...;<VOLTAGE_PAIR[n-1]> The format for <VOLTAGE_PAIR[k]> is: <VOLTAGE1[k]>,<VOLTAGE2[k]> The format for <TIMER_LIST> is: <TIMER4>,<TIMER5> Notice that: The full packet only has '!' at the start, ':' somewhere in the middle, and '\r' (<CR>) at the end <VOLTAGE_LIST> only has 1 delimiter: ';' <VOLTAGE_PAIR[k]> only has 1 delimiter: ',' <TIMER_LIST> only has 1 delimiter: ',' You can translate the above breakdown into very simple LabVIEW code: Notes: The pink VI is <vi.lib>\AdvancedString\Split String.vi To make it appear in your palette or Quick Drop, install Hidden Gems in vi.lib from VIPM or http://sine.ni.com/nips/cds/view/p/lang/en/nid/212430 Alternatively, you can use OpenG's String to 1D Array.vi Regular Expressions (Regex) are very useful for string manipulations. Play with it at https://regexr.com/ (note: You might need to replace '\r' with '\n')
    1 point
×
×
  • Create New...

Important Information

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