george seifert Posted May 9, 2007 Report Share Posted May 9, 2007 http://forums.lavag.org/index.php?act=attach&type=post&id=5767http://forums.lavag.org/index.php?act=attach&type=post&id=5769 I hope someone can help me think of a way to do the following. I'm getting data from hardware (always U8) that I need to distribute to a series of clusters. Each cluster can consist of various combos of booleans and numerics that total to 8 bits (see an example cluster in the attached VI which is explained below). I need to somehow divide up the incoming bits to the cluster elements. I was hoping to find a generic way of doing this instead of needing a pile of case statements. It would make maintenance easier to when I have to add more clusters. I put the format in the clusters caption that shows how many bits are in each part of the cluster (for the attached VI the caption would contain 1_3_1). I can retrieve the caption in the subVI and that at least gives me some idea on how to distribute the data. I just can't figure out how to bundle the data to send it back to the cluster. Here's one thing I tried. I converted the cluster (via a reference and then to a variant) to XML, changed a few values in the XML based on the incoming data and then tried to convert back again to a variant to send to the cluster reference value (see attached VIs). Converting to XML is easy, but I get an error when converting back to a variant that says that "the data type of the variant is not compatible with the data type wired to the type input". Is there any way to convert back to a variant? It's easy when the actual cluster is available, but I need to do the conversion in a subvi with a reference to the cluster. George Quote Link to comment
Yair Posted May 9, 2007 Report Share Posted May 9, 2007 I can't say I fully understand what you want to do, but you might wish to check out the OpenG Data Tools. Specifically, the Variant Configuration VIs which use the data tools to save and load clusters. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.