Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/23/2010 in all areas

  1. I see that there has been a ?!@*-ton of spam on the OpenG General Discussion forum this weekend. Just a thought; maybe the discussion forums could be moved to LAVA? It might provoke a bit more involvement in OpenG in general and the more robust forum software would stop the spammage (is spammage a word?)
    1 point
  2. You can take a look at the GXML code as a starting point for implementing your 'Anything' to binary conversion. GXML converts Anything to XML. It uses a variant input and then converts the variant to a flattened string. Then it recursively parses the flattened string, ignoring the outer variant container, to convert its contents to XML. You can replace all of the XML conversion code with your own code. If all you want to do is to remove the outer variant container from the flattened string then it won't be much work at all and you won't even need to get into recursive parsing.
    1 point
  3. First step would be to XOR the old and new array. Then using a 'Not Equal to 0' node, you will get a boolean array where true means 'changed'. Then you need to check how much elements are true. You could convert it into a 0, 1 intger array, and use the sum of the array to get the number of changed elements. Ton
    1 point
  4. You pretty much need to use a variant, or of course have an army of polymorphic VIs which demand every type be accounted for. I have done what you're describing using variants. They do have meta information, which you take advantage of. I don't have the info handy, but there is a library meant to handle variants, I believe it is called VariantType.lvlib and is somewhere in your vi.lib/utilities folder. A word of caution though that since these VIs are not on the palette NI might change them some day... The key is recursion. Take the variant, act accordingly if it is a primitive type (bool, double, etc). If it's a complex type (cluster, array, waveform, etc) do what you need to do then recurse on the contained type(s). Note because variants do involve a lot of copying, this can get prohibitive for deep/large data structures. You will never get as good performance as doing a "hardwired" VI for whatever your type is. I ultimately abandoned my variant approach because serializing my main data structures could take minutes using this method (compared to seconds by keeping things type specific). I still use it for simple or small data structs though.
    1 point
×
×
  • Create New...

Important Information

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