NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
JewgenijTarschis
Posts: 7
0 Kudos
Accepted Solution

How can I change block properties from Xmath?

I want to modify some block properties from Xmath, for example to change name of a constant block. I tried something like

 

Constant1.name="new name";

 

Can anyone help me?

 

Thanks,

Jewgenij

Member
rfwilson
Posts: 12
0 Kudos

Re: How can I change block properties from Xmath?

You can use the SBA (SystemBuild Access, see Chapter 7 of the SystemBuild User guide ) routine modifyblock command to change any SystemBuild

block property. All created blocks have a block id which must be specified as part of the modifyblock command.

For example:

 

      modifyblock 2,{name="myblock",color=2,size=[100,100]}

 

or to create a gain block

 

      createblock "gain",{gain=2.5,name="accelConstant"}

 

to retrieve the block id of a created block, pass in a variable set to zero, createblock will set the variable to the created block id

 

      myid = 0

      createblock "deadband",{id=myid}

      modifyblock myid,{color=1,inputs=2}

 

You can also get properties of a block using the queryblock command.

 

      [t=threshold,c=color,l=location,t=blocktype] = queryblock(myid)

 

 

See Chapter 7 of the SystemBuild Users Guide for more commands and details

 

 

 

     

 

Member
JewgenijTarschis
Posts: 7
0 Kudos

Re: How can I change block properties from Xmath?

Thank you very much for this answer!
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page