Dynamically enabling/disabling opc-binding to shared variables?

Hi.
I've got some shared variables binded to my OPC server, but sometimes some variables need to "ignore" the OPC updates and and be simulated, and in some cases, all of the variables.
So, I've got an application to dynamically change the shared variables properties: Network.UseBinding and Network.URL to "connect to" or "disconnect from" the OPC server, but is there a way to "unbind" the whole library from the OPC quickly and restore it back when need it?
I tried creating and deleting the IO server programatically but the variables go "bad"...
Is this is a good practice or should I change the method?

Hi Keptat, you can bind them directly to the OPC sever but you need to add
psp: at the begining.
For example 
   psp:\\localhost\IOServer\ModbusSlave1.000001
   psp:\\aebenjamin\IOServer\OPC1.Channel_0_User_Defined.Ramp.
   psp:\\ host \ library\IOservername.register
 An easy way to find the complete address y bind a Variable with psp
binding to the OPC server and you will get the path.
In the example code it gets the psp address from a Library, but won't get
you the directions of the registers inside the IOserver, so you need this list
manually.
Another option is create 2 libraries one with the variables binded to the IO
Server and the other binded to the simulated info, in this case you just have
to point to the library, and get the address of all variables.
 Also you have to make sure the OPC server is deploy and you can see it
in the Distributed System Manager
Best Regards
Benjamin C
Senior Systems Engineer // CLA // CLED // CTD

Similar Messages

  • Use buffering and psp with datasocket-VIs and without any binding and shared variable node

    Hello,
    I'm using LV 8.5.
    I'm trying to develop a multiplatform (windows and mac os x) and multi-computer application. II want to get executables running on each device, communicating through the network. Communication process includes datas (such as images) and events messages (something like "Hello, I got an error" or "youyou, my work is done" or "I'm hereeeee!!!!...."). I do need a communication without any loss of data.
    I worked a lot and wanted to test a psp-based design, without any binding nor shared variable node (mac os...) using data socket VIs and SVE buffering.
    I managed to :
    - deploy shared variable library dynamically (even in an executable)
    - communicate between two PCs with datasocket VIs
    However, I never managed to enjoy buffering (even locally with one VI doing the deployment and writing datas and another one for reading).
    I worked hard (dynamic buffering setting, dynamic buffering watching like in  http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/buffering_data/ and in the example "DS send image" and "DS receive image" in the labview examples, trying to use "?sync=true" in the URL, etc...) but no way to get things work.
    I attached a jpeg of an example of receiver and sender. I use wait commands in both receiver and sender to test buffering
    Receiver do receive datas (the last written) but buffering doesn't work.
    Did somebody did that before ? (better than me...)
    Thanks
    Bo
    Attachments:
    Sender.JPG ‏87 KB
    Receiver.JPG ‏96 KB

    Hello,
    Indeed my problem has been solved. My error : in the While loop of the receiver VI, I always reactualize the PacketsMaxBuffer and OctetsMawBuffer parameters, what resets the buffer and make it appears ineffective.
    I now set  the PacketsMaxBuffer and OctetsMawBuffer values only once at the begining of the VI and the psp buffering works perfectly.
    Sorry for the desagreement...
    Bo

  • Opc server into shared variable

    Hello,
    I am writing a program to read hundreds of OPC signal from a server. The server is a  localserver in the PC but its not a Labview server. My labview program reads the OPC signal thru data socket into a Labview Library.(Variable type=single process)
    This way is working but not optimal. I have read in Help that I can use a Network-published shared variables. Does this Network-published be able to read the signal from my opc server thru a network path without using data socket? Must it be a Labview server? 
    this is an example for my opc address
    opc://localhost/hteControl_OPC_DA_Server/PLC_FI010_ValueLimit_SP
    Thanks
    Solved!
    Go to Solution.

    fmpfmpf wrote:
    Hello,
    I am writing a program to read hundreds of OPC signal from a server. The server is a  localserver in the PC but its not a Labview server. My labview program reads the OPC signal thru data socket into a Labview Library.(Variable type=single process)
    This way is working but not optimal. I have read in Help that I can use a Network-published shared variables. Does this Network-published be able to read the signal from my opc server thru a network path without using data socket? Must it be a Labview server? 
    this is an example for my opc address
    opc://localhost/hteControl_OPC_DA_Server/PLC_FI010_ValueLimit_SP
    Thanks
    LV-DSC (Data Logging and Supervisory Control) aloows you to "bind" the NSV to an OPC server.
    As long as the server os OPC compliant it should work and has ben the case for me.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Front Panel binding of shared variables very slow initialization / start

    Hello @ all,
    I am using a server running Windows2000 and LV 8 DSC RTS for datalogging. All shared variables are deployed on that server.
    I am now facing the problem, that all front panels running on the clients using the network shared variables on the server take very long to sync on startup. First the flags on the controls bind to the shared variables turn red, after up to ten minutes they start to turn green. The panels use up to 40 controls bind to the shared variables.
    All firewalls are turned off. I tried to connect the client to the same switch the server is connected to. Same problem. Does anybody have a clue?
    Thx for your quick answers.
    Carsten 

    While I can't offer any solution to your problem, I am having a similar issue running LV8.0 and shared variables on my block diagram (no DSC installed).
    When using network published shared variables, it takes anywhere from 30 sec to 4 min from the vi start for any updates to be seen. Given enough time, they will all update normally, however this 4 minute time lag is somewhat troublesome.
    I have confirmed the issue to be present when running the shared variable engine on windows and RT platforms, with exactly the same results.
    In my case, the worst offenders are a couple of double precision arrays (4 elements each). They will normally exhibit similar "spurty" behavior on startup, and eventually work their way up to continuous and normal update rates. Interestingly enough there are no errors generated by the shared variables on the block diagram.

  • Binding a shared variable to a NI-PSP data object does not work

    Hi,
    I want to share data between a RT-target and one or more hosts (LV 8.6.1). The network shared variables are deployed to the RT-Target.  According to NI accessing shared variables from another project or host has to be done by defining a shared variable on the host and aliasing it to the NI-PSP data object on the target.
     I did that and the host shared variable generated an error (0x8BBB0011) during runtime.
    Next I aliased to a shared variable deployed on the host from another project. This did work.
    Another thing I tried was to bind the variable from the RT-target to a display element:
    This is working !!! And as you can see the path of the NI-PSP data object is exactly the same ! So what is the difference between binding a data object to a shared variable and to a display element?
    Is there a bug in the SVE or am I missing something here?
    The host project:
    The publisher VI
    Hope, someone has an answer.
    Regards
    Matthias Quade
    Solved!
    Go to Solution.
    Attachments:
    AliasTestWrite-RT.vi ‏8 KB
    AliasTestConsumer.vi ‏8 KB

    Dear Mr. Quade,
    thank you for posting at the National Instruments Forum. There is a known issue with the path of the bound variable with LabVIEW 8.6.1
    Please download the patch for LabVIEW 8.6.1, it should solve your problem:
    http://joule.ni.com/nidu/cds/view/p/id/1255/lang/de
    Best regards from Munich
    MarianO

  • [ADF UIX] Dynamically enabling/disabling fields

    Hi
    Another newbie question.
    Does anybody have any pointers on how to dynamically set the read-only property of a messageInputText field dependent on the value of another field in an ADF UIX input-only-form?
    To set the scene: I have a VO with the following columns:
    1) id
    2) subtype (values L or N)
    3) field1 (only editable when subtype = L)
    4) field2 (only editable when subtype = N)
    When the user creates a new record, the subtype will default to L. I need field1 to be enabled and field2 to be disabled. If the user changes the subtype field to N, field1 must be disabled and field2 enabled.
    Is this possible? Or is this best left to the spanking new ADF Faces?
    (My environment: JDeveloper 9.0.5.2 build 1618)
    Thanks!
    CM.

    Some research reveals one method to do this: EL (Expression Language).
    As an example I had the following messageLovInput that I wanted to dynamically make read-only (similar to enabling/disabling) dependent on a value in another field 'InputRequiredInd'. As such the following tag was implemented:
    <messageLovInput
    model="${bindings.DsvId}"
    id="${bindings.DsvId.path}"
    destination="dataSetValidationRulesLevelOneLov.uix"
    partialRenderMode="multiple"
    partialTargets="_uixState"
    readOnly="${!empty bindings.InputRequiredInd.inputValue ? false : true}"/>
    You'll note in the readOnly element an "EL" expression. Essentially this says if the InputRequiredInd is not empty then return false otherwise true.
    A useful reference:
    http://www-106.ibm.com/developerworks/java/library/j-jstl0211.html
    I hope this is helpful to someone!
    Cheers,
    CM.

  • ADF Faces: Dynamically enabling / disabling client validation

    Hi Frank,
    Im using JDeveloper 11.1.1.2.0 version. I want to disable the client side validation for some condition. I have read related information from Frank blog .
    But In that frank used adf-faces-config.xml file for the following configuration.
    <adf-faces-config xmlns="http://xmlns.oracle.com/adf/view/faces/config">
    <skin-family>oracle</skin-family>
    <client-validation-disabled>true</client-validation-disabled>
    </adf-faces-config>
    But in my application, I could not find adf-faces-config.xml file. I dont know where to configure please provide me the information.
    Regards,
    Felix

    Hi,
    in JDeveloper 11g this no longer is an option. To disable client validation you set immediate=true on the UI component, which youalso can do dynamically. Howerver, ensure you refresh the component after changing the immediate property state.
    Frank

  • Dynamically enabling/disabling results using RunState.Execution

    We run with our station options set to have results disabled for all sequences.  BUT, at one point in a sequence run from the tools menu (i.e., not using the process model), we want to temporarily turn on results recording, run a step or two to record results, and then turn result recording back off.
    I am calling an ActiveX/Com step to enable results using  RunState.Execution DisableResults(false).  I then run various steps that should be recording results, but my Locals.ResultList remains empty.  Have also tried to calling  RunState.Execution AddExtraResult, but no luck.
    My true goal is to be able to call the TestReport sequence of the SequentialModel.seq file which takes as its first parameter the "results container".  I want to be able to send a very select, small set of results that are generated from my sequence run from the tools menu.  I tried various ways of creating a "dummy" result list, but was unsuccessful doing that as well.
    Any ideas?

    Barry,
    For RunState.Execution DisableResults to work, The Engine and | or  Sequence must also be False depending on what setting you have set to disable.
    So in your case you need to set IEngine.DisableResults(False). You dont really need to call RunState.Execution DisableResults(False), use this if you what to switch on | off recording of selective steps rather than all steps in a Sequence.
    Use Sequence.DisableResults to disable all steps in a Sequence.
    Hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Make MultiValue Parameter Dynamically Enable/ Disable

    Hi,
    I have two MultiValue  parameters in SSRS report. Both the parameters are independant of each other.  If I choose value from first parameter, Second parameter should be disabled dynamically. If I choose  value from second parameter, First
    parameter should be disabled dynamically.
    Can this be achieved in SSRS ?
    Is there a workaround to achieve the above scenario ?
    Regards
    G. R. Venkatesh

    Using nulls is one way. Another way is to set a default value say NotApplicable. Just set below expression for default value
    IIF(Len(Parameters!SecondParameter.Value) > 0,"NotApplicable",Nothing)
    Similarly for the other parameter
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Hi Visakh,
    I am new to SSRS.
    Could you please share a workaround sample for my scenario
    I tried to implement the expression for Multivalue  parameter1 default value, The parameter1 has below expression
    =IIF(Len(Parameters!SecondParameter.Value) > 0,"NotApplicable",Nothing)
    and Parameter2 has below expression
    =IIF(Len(Parameters!FirstParameter.Value) > 0,"NotApplicable",Nothing)
    I get a error saying "The expression references the parameter 'parameter2' which doesn not exist in the parameters collection. Letters in the names of parameters must use correct case"

  • Dynamic enable/disable

    Hi
    in my application i have tabular form with report 5 columns
    p1,p2,p3,p4,p5
    and a button "add row" when I click on add row button
    all 5 columns should be enabled but once i submit and add the row in the table
    p1,p2 and p3 should be disabled or locked not updatable,.
    i should able to update only p4 and p5 columns
    i checked the forum but could not get any matching my requirement.
    can any one please help me how to do this.
    thanks very much in advance.

    Hi
    in my application i have tabular form with report 5 columns
    p1,p2,p3,p4,p5
    and a button "add row" when I click on add row button
    all 5 columns should be enabled but once i submit and add the row in the table
    p1,p2 and p3 should be disabled or locked not updatable,.
    i should able to update only p4 and p5 columns
    i checked the forum but could not get any matching my requirement.
    can any one please help me how to do this.
    thanks very much in advance.

  • Empty Shared Variables & Data Binding not working in dynamically called VI

    Hi,
    I have just upgraded a system from LabVIEW 2011 to 2012 DS2.  I have a real-time PXI system running several shared variables, hosted on the PXI.
    After what appeared to be a succesful upgrade I have a couple of odd issues. 
    1.  The PXI writes test data into a network shared variable, based on a typedef of an array of custom clusters.  The variable is disconnected from the typedef, as RT does not function with shared variables linked to typedefs.  It seems that writing a seingle entry to the array is fine, but writing multiple entries causes the variable to appear empty. 
    I still need to debug this a little more, as while I was station to do so this other issue popped up.
    2.  I have some controls on the Host app with data binding to shared variables.  The host app uses three VIs dynamically called into the wrapper VI.  One of these called VIs is not able to connect to its variable when inserted in to the wrapper, but it can if run independently.  The other two have no such trouble.  Where I see a problem, the indication LED is grey and the mouse-over text reads "no status".  What does this mean?
    Any clues?
    Thanks,
    Ian

    I have changed the Invoke Node to a Run Asynchronous node, and this seems to have fixed the data binding issue. 
    The other issue may be related to a bug fixed in 2012 SP1:
    368648 Network Stream operations return Error 42 when data type contains nested clusters of typedefs
    I am now getting error 42 when reading a particular network shared variable.  This variable contains the results of measurements, in a data type which contains an array of nested clusters of typedefs.  When there is a single entry in the array I can read the variable fine, but when there is more than one entry in the array it does not read and I get error 42.
    I have downloaded 2012 SP1, and will see if this helps. 
    Ian

  • Shared variable vs. data binding

    Hi,
    I try to write a program which communicates motor drives through ethernet and I use OPC server and shared variables created using PLC. I created front panel indicators in a while loop with 50 ms cycle to read motor encoder position, status etc. When I try to do this with wiring shared variable to indicator and with changing the data binding property of the indicator browsing the same variable from the project library, data binding seems to respond slower than wiring the shared variable to indicator directly. Can anyone explain why?

    Hi mhn05, 
    I'm not exactly sure why it would be operating slower.  Do you have code that you can upload that benchmarks or tests the speed of these, side by side? 
    Thanks, 
    Dave T.
    National Instruments
    FlexRIO & R-Series Product Support Engineer

  • Binding Shared Variable to Source

    Dear all,
    I'm currently working on a project that requires the use of shared variables. The shared variables will be network published and programmatically created using properties nodes. However I encounter one error and one problem in the process of doing so.
    1) I programmatically bind the shared variable directly to the fieldpoint channel (data item) by writing the URL \\10.0.0.1\FP\1AIO\00 when i create the shared variable. The shared variable can be created successfully but when i deploy it, it generates an error which seems to tell me "it is out of range". Can anyone help me to rectify this problem?
    2) The 2nd question will be, as my fieldpoint is connected to a DHCP server. At the start when i create the shared variable programmatically, i could bind the shared variable directly to the data item by writing the URL to its property. However, during the process of deployment, the dynamic IP address assigned to my fieldpoint may change . How can I ensure that the shared variable continue to bind to the right fieldpoint channels respectively? even though the IP address changes?
    - Or is there any method that I could view all the network data items in a table? a list? or an array? so that I can link them to the URL.
    I tried using the data socket URL.vi, I can only select the data item one by one.. this will be tedious for 100 or 200 I/O points..
    Will greatly appreciate for any advice and help. Thanks in advance.

    Try this.
    Give your fieldpoint controller a computer name through MAX.  Then instead of referencing it by 10.0.0.1 in the URL's of the shared variables reference it by computer name.  So  \\MyFPmachine\FP\1AIO\00 instead of  \\10.0.0.1\FP\1AIO\00.
    Dynamic IP's can definitely cause headaches, and it would be best to use static IP's if possible, but doing this method should help.  It seemed to work for me.  I found when you browse for the channel in LV, it wants to give it the IP address by default, but it was possible to edit the string and paste in the computer name.
    Message Edited by Ravens Fan on 01-10-2007 11:01 AM

  • Bind shared variable to multi-chan​nel item

    How do i bind a shared variable (array) to a Fieldpoint multi-channel item?
    When i configure the shared variable, and click browse to select the network item to bind to, i can select individual channels but there's no "All" tag.

    Actually I suspect that the problem is in the National Instruments OPC Server.
    DataSocket can read array data types from an OPC Server, but National Instruments' OPC Servers do not publish data in an array format.
    Probably the easiest solution is to publish your shared variable in your network but don’t bind it trough the opc server, instead you have to use it like a standard global variable (bind to source method).
    Give a look to this document may lead you to a better solution.
    http://digital.ni.com/public.nsf/websearch/FA61036​7EC62574186257118005089F2?OpenDocument
    Hope these two tips can help you
    FiloP
    It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
    Richard P. Feynman

  • Problem while binding variable progmatically shared variable in RT

    Hi All,
    I have a problem while programaticaly binding the shared variable from RT controller.
    The application scenario is as follows 
    I have three cFP controllers and two
    server PCs in my application. Servers are implemented with Redundancy. If server
    1 fails, server 2 will take care and vice versa. The cFP controller program is
    intelligent enough to detect this switching and identify the active server.
    I am using shared variable
    communication for transferring the data between cFP and Active Server. This I am
    achieving by binding the cFP variable to Server variables. I can bind server
    variables to cFP variables also. But I have some advantage with first one rather
    than second one.
    Now, cFP Variable to Server Variable
    binding I can do in two ways.
    Right click the variable in Project
    Explorer and select the network URL.
    Other method is by programmatic
    binding.
    Now Programatic binding should be
    done in cFP controller since cFP controller should bind to second server
    whenever it detects switching.
    For this, I tried with
    SharedVariableIO property node like in the below attached diagram 1.
    But I was getting a deployment error
    shown in attached diagram 2.
    The second method I tried is by
    transferring a shared variable library cFP Library.lvlib to cFP through FTP and
    opening the Library variable reference and by using the variable property node.
    This way of binding was successful when I run from windows PC. But in RT
    controller, it was giving me Error 1 while opening a
    library.
    I am attaching the code with this post
    Summary of the problem is I am not able to progmatically bind variables from
    RT Controllers
    Kindly help me in solving this
    problem.
    Regards,
    Blackperl
    Message Edited by blackperl on 08-18-2008 08:29 AM
    Message Edited by blackperl on 08-18-2008 08:31 AM
    Attachments:
    Code and Library.zip ‏27 KB
    Diagram 1.jpg ‏15 KB
    Diagram 2.jpg ‏25 KB

    Hi All,
    I have a problem while programaticaly binding the shared variable from RT controller.
    The application scenario is as follows 
    I have three cFP controllers and two
    server PCs in my application. Servers are implemented with Redundancy. If server
    1 fails, server 2 will take care and vice versa. The cFP controller program is
    intelligent enough to detect this switching and identify the active server.
    I am using shared variable
    communication for transferring the data between cFP and Active Server. This I am
    achieving by binding the cFP variable to Server variables. I can bind server
    variables to cFP variables also. But I have some advantage with first one rather
    than second one.
    Now, cFP Variable to Server Variable
    binding I can do in two ways.
    Right click the variable in Project
    Explorer and select the network URL.
    Other method is by programmatic
    binding.
    Now Programatic binding should be
    done in cFP controller since cFP controller should bind to second server
    whenever it detects switching.
    For this, I tried with
    SharedVariableIO property node like in the below attached diagram 1.
    But I was getting a deployment error
    shown in attached diagram 2.
    The second method I tried is by
    transferring a shared variable library cFP Library.lvlib to cFP through FTP and
    opening the Library variable reference and by using the variable property node.
    This way of binding was successful when I run from windows PC. But in RT
    controller, it was giving me Error 1 while opening a
    library.
    I am attaching the code with this post
    Summary of the problem is I am not able to progmatically bind variables from
    RT Controllers
    Kindly help me in solving this
    problem.
    Regards,
    Blackperl
    Message Edited by blackperl on 08-18-2008 08:29 AM
    Message Edited by blackperl on 08-18-2008 08:31 AM
    Attachments:
    Code and Library.zip ‏27 KB
    Diagram 1.jpg ‏15 KB
    Diagram 2.jpg ‏25 KB

Maybe you are looking for