mje Posted June 28, 2010 Report Share Posted June 28, 2010 I have a string containing a task name that is serialized to file. I'm currently just casting it back to a task and all's well: But is there a better way to do this? Quote Link to comment
Grampa_of_Oliva_n_Eden Posted June 28, 2010 Report Share Posted June 28, 2010 I have a string containing a task name that is serialized to file. I'm currently just casting it back to a task and all's well: But is there a better way to do this? Better? Just wire the string and let LV do the conversion? Everytime I benchmarked explicit coercion vs implied the implied wins. Ben Quote Link to comment
mje Posted June 28, 2010 Author Report Share Posted June 28, 2010 When? But? How? I swear I tried that and got a broken wire... Thanks Ben! Quote Link to comment
hooovahh Posted June 28, 2010 Report Share Posted June 28, 2010 Yeah the Read and Write DAQmx task can use a string. There is also a VI under DAQ Utility to take an array of string, and convert to a single string, that can be Read and get all of the channels. Quote Link to comment
TG Posted July 7, 2010 Report Share Posted July 7, 2010 I have a string containing a task name that is serialized to file. I'm currently just casting it back to a task and all's well: But is there a better way to do this? Dare I to say that both are identical except with the manual typecast a person can be more assured of the resource being allocated? Would it be incorrect to use the manual method of typecasting ? Quote Link to comment
mje Posted July 7, 2010 Author Report Share Posted July 7, 2010 I can't say I know exactly what the native DAQmx Task Name type is, it might be equivalent to a string, but there also might be underlying info which can't be resolved via the cast (though it seems to work...no idea how robust it is). As such I'd go with the implicit cast, if for no other reason than historically implicit operations can be faster. 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.