03-23-2007 02:20 PM
03-23-2007 02:32 PM - edited 03-23-2007 02:32 PM
Message Edited by Srđan Zirojević on 03-23-2007 02:33 PM
03-24-2007 05:33 PM
Thanks for your prompt response, Srdan. I was looking over the niSE requirements in the link that you posted, and I have a few more questions, specifically regarding the following two requirements:
· mySwitch_Connect, (shall set the “connected” state in the driver such that a successive connect call with the same channels will give an error)
· mySwitch_Disconnect (shall change the state in the driver so the channels are marked as not connected and return an error if the two channels are not connected)
These rules imply that there must be a Disconnect call for every Connect call on a switch. For our system it does not really make any sense to disconnect a switch (there is no disconnected state), and furthermore, there are situations in our system where multiple paths contain the same switch. Although the IviSwtch class specification does not allow for implicit disconnections, this system does not really have to be class compliant, it just has to work with niSE. So I would propose to always maintain an IviSwtch state of 'Disconnected' for all IVI Channel connections in the system, regardless of the actual hardware state.
The IviSwtch functions would then have the following behavior using both simulation and non-simulation modes:
Connect would change the hardware state (if not in simulation mode), but not change the IviSwtch state and would always return success. Thus Connect could be called multiple times consecutively.
Disconnect and DisconnectAll would not change hardware state or the IviSwtch state and would always return 'Path Remains' warning.
SetPath would always return success if the syntax is valid and the path is possible, regardless of existing connections- since the IviSwtch state is always 'Disconnected' then there are never any existing connections.
GetPath would have no way of knowing whether a path was currently connected, and so would return the path if it is possible to create, regardless of the connection state.
CanConnect would always return true if the path is possible to create, regardless of the connection state.
Will the defined IviSwtch behavior work with niSE?
Thanks!
Mark
PS- I had to write this message twice because my session timed out before I could post the first time, and when I clicked the ‘back’ button my message was gone- that was a bit annoying to say the least. The second time around I entered the message in Word and then pasted into the message body.
03-27-2007 09:56 AM
03-27-2007 09:57 AM
03-27-2007 12:53 PM
Hi Srdan,
Thanks again for your response and suggestions. Unfortunately my problem is a bit larger than I have described so far, perhaps a more detailed description will give you some insight as to why I proposed the implementation that I did:
The bad news:
1) This is an RF switching tray with 20+ switches including SPDT (form C), SP4T, SP6T, Transfer switches (think of a box with one position being two horizontal connections and the other being two vertical connections), Terminated 4 port switches, and Matrix switches (where any one of six ports can connect to any other). NONE of these switches has a state in which it is 'disconnected'.
2) It is a customer requirement to use niSE to control the switches.
The good news:
3) The IviSwtch driver will only be used in this particular application and does not have to be a general use IviSwtch driver. It just has to work with niSE- niSE is the only client for this driver. Given the constraints that you and I have been discussing, I might even be able to get the customer to agree to using this driver with one specific version of niSE (maybe).
4) This application requires only the following functionality from niSE:
- create hard wires between switches to specify the switching topology
- create path definitions from one side of the tray to another via switches and hard wires.
- connect pre-defined paths; paths are not created ‘on the fly’, but prior to run time.
In light of this further information, how might you suggest that the IviSwtch driver be implemented for use with niSE?
Thanks again for all of your help!
Mark
03-27-2007 02:26 PM
03-28-2007 12:24 PM
Hi Srđan,
You wrote:
Yes, indeed, you have convinced me that implicit disconnects in the IviSwtch driver are a bad idea. Thank you for taking the time to explain the state tracking that niSE does and the reliance upon conformance to IVI standards.
So to summarize, my approach to driver development will be to follow the requirements outlined in the document:
http://zone.ni.com/devzone/cda/tut/p/id/3449
The operation of the Disconnect and DisconnectAll functions will be to mark the connection as 'disconnected'- even though no change is actually made to the hardware- and return the MYSWITCH_WARN_PATH_REMAINS warning. The client will then necessarily need to call Disconnect for every Connect call.
Thanks again for your time and information. 🙂
Cheers!
Mark