取消
显示结果 
搜索替代 
您的意思是: 

cant assign com port to resource name

I'm setting  up a vi that will be used on a target pc, where the com port available on the target  (com5) is different from the ones available on my development pc. I'm trying to create a constant or control at the input of my hardware vi that identifies the com port, but it won't let me assign com5, apparently because my development pc doesn't have com5 available. If I give it a selectable control that I can select at run time on the target, it defaults to a com port not available to the target and when launched it hangs up. How can I hardwire (make default) the resource name to a com that is unavailable on my dev. pc?
0 项奖励
1 条消息(共 10 条)
6,356 次查看
Have you tried wiring a simple string control to your VISA Resource Name Terminal?

It should work as long as the name you type the com port name exactly as it would be if using the standard I/O input control.

This method should allow you to use whatever com ports are available on your development and target PC's.
Mark
NI App Software R&D
0 项奖励
2 条消息(共 10 条)
6,341 次查看
 Mark, please see attached screenshot of my vi. I tried what you suggested. The drop down constant that is wired to the CILXS vi is what pops up when I create control, so that is the text format I duplicated with the unwired string constant shown above it. Of course, when I tried to use it I deleted the drop down constant and wired in the string constant, and it didn't work. The error message says insufficient location information. Any other ideas?
0 项奖励
3 条消息(共 10 条)
6,299 次查看

As a work around, maybe it would be worthwhile to go into Device Manager on your development PC and rename it com port to be Com5 instead of Com1.  When you are done with the project, then you can go back and make it com1 again.

Are you trying to actually run this VI on the development PC?  When are you receiving the error message?

0 项奖励
4 条消息(共 10 条)
6,269 次查看
Try typing in the port name as ASRl1:INSTR without anything additional in your string constant including quotation marks.
Mark
NI App Software R&D
0 项奖励
5 条消息(共 10 条)
6,267 次查看

Check port2.vi example at this forum... that's what you're looking for... also you can create an INI file where you save wich COM port is used by your application. First time your application runs at target PC it reads that INI file, it finds that no COM port has been selected and run port2.vi example, modify INI file and, that's it !! ... your application won't have to ask for a COM port next time it runs, because a valid COM port is already at the ini file.

 

0 项奖励
6 条消息(共 10 条)
6,261 次查看
That works! Thank you. As usual, I like to exhaust all my NI documentation before going on this site. Can you direct me to NI Labview documentation that spells that out that I should have read?
0 项奖励
7 条消息(共 10 条)
6,224 次查看
I did a search for port2.vi in the entire forum & only got a hit on your reference above. Can you send me that vi? It looks like something I can use in other projects. Thank you.
0 项奖励
8 条消息(共 10 条)
6,222 次查看
Hi wb2nvy,

click the "reference above", then right-click the port2.vi & select "save as..."! No need to send this vi to you...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
9 条消息(共 10 条)
6,219 次查看
Muchas gracias!
0 项奖励
10 条消息(共 10 条)
6,214 次查看