取消
顯示結果 
搜尋替代 
您的意思是: 

Question regarding functionality of "Search 1D Array Function" in TCP/IP context

已解決!
前往解決方案
In the attached tcp_Registry.vi, the vi uses the "Search 1D Array Function".  I can't figure out why this function can't find the index of the input element, since the inputs to the function match...
下載全部
0 積分
1 條訊息(共 31 條)
4,175 檢視

Please do not embed images inside of RTD files and then put them inside of zip files. You can save screenshots as PNG which makes them really small and upload them directly. 眨眼表情

 

With respect to your code: You have highlighting on, and it clearly shows that the array of reference being fed to the Search 1D Array function is empty, so there's nothing to find.  I don't understand what your problem is. Can you provide more information?

0 積分
2 條訊息(共 31 條)
4,159 檢視

Hmmmm...kay.  Guess I didn't realize it was empty, versus being a single element array with it's only element being "0".  In that case, I'm not sure why the array is empty.

 

First, some context: I have a LeCroy LSA1000 analyzer/digitizer that I can't read/write from, as something goofy is going on with the TCP VI's.  I noticed when running some of the VI's contained within the tcp_instr library for the LSA1000 (obtained from NI's driver net) that an error is produced in any VI's using the tcp_Registry.vi.  Sooo, I'm trying to understand what this vi is doing, and see that the problem occurs at this Search 1D Array function, since the element can't be found in the input array.  However, I'm not sure what the input array should contain, or how the tcp session part affects this....

0 積分
3 條訊息(共 31 條)
4,156 檢視

When you're in highlight mode the little yellow tooltip that appears over wires will tell you the value in case of scalars, and the number of elements in case of arrays. The "#0" indicates an empty array.

 

As far as the drivers are concerned: They seem to use the TCP/IP VIs instead of VISA. I don't know why, but there you go. The "TCP Registry" VI is just an Action Engine. It keeps track of open connections in case you're connecting to more than one LSA1000. Not sure why it was written that way, but there you go. What error are you seeing? The most likely error you're seeing is the "invalid object" error which is due to not having a session registered. Which VIs from the instrument driver are you using? Does the "LCLSA Initialize" work? Can you upload your code? Have you verified that you can ping the instrument on the network?

0 積分
4 條訊息(共 31 條)
4,137 檢視

Thanks for that info!  You are correct that the error I'm getting is that invalid object error.  I get this error is I run the tcp_Register.vi by itself, or if I run any other vi in the library that uses the tcp_Registry.vi.  I haven't used any of my own codes yet as I can't get this driver/library of codes for the LSA1000 to work yet, and I need to use them as a part of my main project.  I can indeed contact the instrument via pinging at 172.25.1.2.

 

The "LCLSA Initialize" vi does work.

0 積分
5 條訊息(共 31 條)
4,117 檢視

I was a bit surprised this morning by the fact that the Initialize vi worked, so I decided, "What the heck?" I'll try the "LCLSA Wave Save To File.vi" again, as I haven't been able to get this one working without errors for the past few months.  And, magically, it worked!  I didn't believe it, so I ran it again - and it worked again!  I still didn't think this was true, so I ran a slightly modified vi I made, "LCLSA Wave Save To File_looped.vi", which just repeats the vi for multiple iterations to create multiple data files.  And this worked, too!  I have NO idea why today everything seems to be fine - I've seriously had issues with the stuff for at least 3 months.  However, I'm just going to go with the flow and see if I can now implement this stuff in my own application now and will let you know how that goes.

 

A quick question - do you have any suggestions as to how to view the data files properly?  I believe they come out as binary, but look like mumbo-jumbo when viewed in a text editor like WordPad.  Thanks!

0 積分
6 條訊息(共 31 條)
4,110 檢視
Alright, I've found something that doesn't work.  When I run the "LCLSA Application Example" vi, I get that "invalid object" error right away when the sub-vi "LCLSA Vertical Setup" calls the "tcp_Instr_Write" vi.  Any idea why I'd get the error here, but didn't get it when running the Initialize vi or the "LCLSA Wave Save To File" vi before?
0 積分
7 條訊息(共 31 條)
4,105 檢視

The "tcp Registry" VI is not meant to be used directly. It's designed to be used as a subVI. You need to provide a valid TCP session and that's only available when your program is running. Once your program stops and there are no VIs running there are also no valid VISA TCP/IP sessions. For application code you should only be using the VIs in the "lclsa" LLB.

 

As for reading the files: Those are binary files. The "LCLSA Wave Save To File" writes out some request commands and then reads the binary data from the instrument and saves it to file. The exact format of the data should be defined in the user manual, but it appears to have some header information and then the waveform data. The file sizes look awfully small, though. Basically you would need to use Read From Binary File to read the saved files and interpret the sequence of bytes based on what the manual says. If you're not sure how to do this, please upload the snippet from the programming manual that discusses the format of this data.

Message Edited by smercurio_fc on 06-03-2009 08:46 AM
0 積分
8 條訊息(共 31 條)
4,104 檢視

nellium wrote:
Alright, I've found something that doesn't work.  When I run the "LCLSA Application Example" vi, I get that "invalid object" error right away when the sub-vi "LCLSA Vertical Setup" calls the "tcp_Instr_Write" vi.  Any idea why I'd get the error here, but didn't get it when running the Initialize vi or the "LCLSA Wave Save To File" vi before?

The "LCLSA Application Example" is not designed to be run on its own. It expects a valid TCP/IP session, and that only happens when you run the Initialize function. Look at the way the "Getting Started" VI is done.

0 積分
9 條訊息(共 31 條)
4,101 檢視

First, you rock.  Thanks for helping me understand the intricacies of how this stuff all works, I really appreciate it.

 

Second, the user's manual is conveniently still on the web:

http://www.lecroy.com/tm/library/manuals/LSA1000RM/RemoteControlManual/LSA_RCM_Rev_C.pdf

0 積分
10 條訊息(共 31 條)
4,100 檢視