FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

FP Write.VI Vs FP Write (Polymorphic).VI

I recently up dated from LabVIEW V5.0 to V6.1. In 5.0 I used the FP Write.VI and was able to connect a Concatenate string.VI to the FP Write.VI with no problem. Now with V6.1 the old FP Write.VI has become a (Polymorphic.VI) and it want let me connect the Conatenate string. VI to it as a Polymorphic.

1. WHY IS THIS?

and also I was half way through creating a VI in version 5.0 that used a (NON-Polymorphic FP Write.VI) how do I replace the old with the new when I used the old to insert column headers for data that is coming next from a while loop.(I mean I used the concatenate string function to input headers such as Channel 1, Channel 2, MAX, MIN, Time, Date, etc...then came the data using another FP Write.VI inside the l
oop to wite data to each of the previous generated columns) how can I do this with a polymorphic.VI or better yet where can I find the old FP Write.VI
0 Kudos
Message 1 of 10
(5,171 Views)
THIS IS WHY:
The FP Write (Polymorphic).vi is a enhanced version of the FP Write.vi. In LabVIEW 6.x, the ability to create polymorphic vi's which change one or more input or output datatypes was introduced. The Read, Write and Advise VI's were upgraded and made polymorphic. This allows them to automatically adapt to certain data types, specifically boolean, boolean array, float and float array. This allows the VI to take care of data manipulation and removes the burden from the user. For example, the older FP Read.vi's always returned data as a 1D array of floats. This was fine if you were reading an "All" channel tag from an analog module, but if you were reading a single channel tag from an analog module, the user would need to use an Index Array function to get the first element. If the tag was a boolean "All" channel tag, the user would need to use the Index Array and then a Convert Number to Boolean Array. If the tag was a boolean channel, the user would need to use the Index Array, then a Convert Number to Boolean Array and finally Index the Boolean Array. Now, the VI's handle that by themselves, all a user has to do is wire the correct datatype to the VI and it adjusts for them.

HOW DO I USE THE OLD ONE?
Left click on the FP Write.vi and choose Select Type--> FP WRITE (FLOAT ARRAY). This is the version of the VI that corresponds to the pre-polymorphic FP Write.vi. Also, you could run a custom install of FieldPoint Explorer and choose to install LabVIEW 5 VI's which are non-polymorhphic.

IMPORTANT NOTE BEFORE USING THE OLD ONE:
Please note that it sounds like your old version was modified by someone to accept string data. The original FP Write.vi would never accept string data. In all likelihood, someone modified it, and those modifications were lost when FieldPoint Explorer updated what it considers to be it's own VI's. If the updated VI's were not in the vi.lib directory, they may still exist on your system. If you look at the VI hierarchy (Browse menu), you should be able to find out where the old ones are loading from.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
Message 2 of 10
(5,171 Views)
I understand your comments to my question but it generates another question that concerns a VI that I have attached.

How do I connect the output of the FP Read.VI into the Format to String.VI if it is needed?

The Random Number generator.VI's represent the 8 channels being read by the FP Read.vi

I guess I need to ask what can I place between the FP READ.VI and the Concatenate String.VI that would generate the same layout in excel as it does when i'm using the Random Number generator.VI's if the Format to string.VI isn't needed

The random number generators are used just because I don't know how to connect the FP Read.VI output into the Format String.VI and they helped me by pass the interface of the FP READ.VI and the Concatenate.
VI (if the format string.VI wasn't needed) and finish the development of my VI. so I could come back later with some help from you guys on the interface part.

If you run this VI and open it by using excel you'll see how I need the data to be formated.


thanks for your help.
0 Kudos
Message 3 of 10
(5,171 Views)
There are several ways that this can be accomplished. One of the easiest ways is use the Array to Spreadsheet String.vi as I have done in the modified VI that is attached.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
0 Kudos
Message 4 of 10
(5,171 Views)
excelent...This is my first attempt at creating a VI and your help has been very appreciated.
0 Kudos
Message 5 of 10
(5,171 Views)
When I ran your modified VI and open it in excel the data didn't appear as it did before the modifications. It seems that the 0MAX,0MIN/1MAX,1MIN get TABed to the next row. resulting in the Max/Min data not appearing under their column headers as they did before the modifications.

I know you have a copy of the unmodified verision of my VI so I'm attaching two excell files one showing the data before the modification and the other after.

While I'm waiting for your reply I'll be tring to figure it out myself as one should

Thanks for your help


*note: I'm not sure if it matters but in the original unmodified VI the FP VIs data doesn't come into play but in the modified version the FP VIs actually
return a voltage for Channel 0 and Channel 1 because I have a battery connected to the input of the FP-AI-100. I guess this really shouldn't matter. I'm just mentioning it because as you look at the excel files you'll notice that the data in the files are different from each other. Because one uses the Random Number generator and the other actuall FP-AI-100 measurments.
Download All
0 Kudos
Message 6 of 10
(5,171 Views)
When I ran your modified VI and open it in excel the data didn't appear as it did before the modifications. It seems that the 0MAX,0MIN/1MAX,1MIN get TABed to the next row. resulting in the Max/Min data not appearing under their column headers as they did before the modifications.

I know you have a copy of the unmodified verision of my VI so I'm attaching two excell files one showing the data before the modification and the other after.

While I'm waiting for your reply I'll be tring to figure it out myself as one should

Thanks for your help


*note: I'm not sure if it matters but in the original unmodified VI the FP VIs data doesn't come into play but in the modified version the FP VIs actually
return a voltage for Channel 0 and Channel 1 because I have a battery connected to the input of the FP-AI-100. I guess this really shouldn't matter. I'm just mentioning it because as you look at the excel files you'll notice that the data in the files are different from each other. Because one uses the Random Number generator and the other actuall FP-AI-100 measurments.
Download All
0 Kudos
Message 7 of 10
(5,171 Views)
My mistake. I forgot to account for the fact that the Array to Spreadsheet String.vi also adds the end of line characters to the string. If you look at my new modified version, I still use the Array to Spreadsheet String, but I strip the last two characters (end of line and carriage return) from the string, allowing the rest of the data that you have formatted to be used instead.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
0 Kudos
Message 8 of 10
(5,171 Views)
VERY NICE!

a learning question here.

In your newest version you deleted the last two characters using the STRING LENGTH function. I looked under help and found that the STRING LENGTH returns in LENGTH the numbr of charcters (bytes) in STRING.

Question? Is the CHARACTERS the individual readings from the FP READ.VI for channels 0-7 plus the eol & carrage return (just in my case)? If so then I could say there are 10 characters involved (in my case) being channels 0-7 equaling 8 characters plus eol & carrige return equaling 2 characters totalling 10 all together? If I'm right so far the 10 characters then go through the STRING LENGTH (which determines these 10 characters) then through the SUBTRACT
which only sees (numeric readings) this being the number 10 upon which you subtract 2 from equaling 8. Now 8 only being a number is sent to the LENGTH terminal of the STRING SUBSET.VI. The 8 is telling the STRING SUBSET.VI to only pass the first 8 characters of the string right? over looking the last two characters which were the EOL & carrige return. If I'm right here I have one more question reguarding this VI.

The OFFSET terminal. If I was to guess how this works I would say that if I had 10 characters 1-10 but only want to use characters 4-10 I would enter and OFFSET of 3 at the OFFSET terminal which would make the STRING SUBSET only output characters 4-10 in the string?

IF I'm misundertstanding any of this please correct me. The difficulty I'm finding working with LabVIEW is how to relate Strings, Characters, Arrays, Bytes, bits, etc.. and so forht to the actual data I'm working with, but it's coming to me I think.

You've been a big help thanks again.
0 Kudos
Message 9 of 10
(5,171 Views)
I used the string length function because the string may vary it's length slightly from one iteration to the next. By using sting length and subtracting two, I will always have the correct result. Alternatively, if the format specified was different and guarenteed the same length string every time, a constant could be used. With %4f, a value of 10 or 1 being formated will provide a different number of characters, 10 and 9 respectively, including the tab. So assuming all of the numbers were between 9.999999999 and 0, the output string would have 73 characters (8*8 (channels) + 7 (tabs) + 2 (end of line and carriage return).

As for the String Subset.vi, if you have a 10 character string, the charact
ers are addressed(indexed) as 0-9 not 1-10. Thus if you wanted the last six characters, you would set the offset to be 4.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
0 Kudos
Message 10 of 10
(5,171 Views)