FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying code from one block diagram to another

I cannot figure out how to copy code from a block diagram in an example program to a block diagram in a new program.

Please help.

Thanks.

0 Kudos
Message 1 of 10
(12,152 Views)

Select the region of interest by clicking down and dragging to define a box, press Ctrl+C to copy the region to the clipboard, go to the other block diagram, and press Ctrl+V to paste from the clipboard.

You can also press Ctrl+A in the source block diagram to select the entire diagram.

Ed

0 Kudos
Message 2 of 10
(5,418 Views)

Thanks for the information.

I tried the Ctrl-c and Ctrl-v method in two ways.

1.  Program A has code in the Perioidic Tasks.vi that I want to copy to Program B Periodic Tasks.vi.

     I cannot have the two vi's open at the same time.  Therefore, I opened Program A Periodic Tasks.vi and did the "box" thing followed by the Ctrl-c

     I closed Program A and opened Program B Periodic Task.vi.

     When I did the Ctrl-v all I got was an image of the code.  No editable code.

2.  I opened Program A,  Periodic Tasks.vi and Vision Processing.vi.  I was able to use the Ctrl-c and Ctrl-v method to copy block diagram code from one vi to the other..

It looks like something is done to the Clipboard data when the Program A is closed and then Program B is opened.

Any other suggestions?

0 Kudos
Message 3 of 10
(5,418 Views)

How about this: Do a "Save As" on your source file to a temporary file with a different name, then open your destination file.

0 Kudos
Message 4 of 10
(5,418 Views)

Sounds like you are trying to copy and paste code between two difference version of LabVIEW, which would result in a picture being pasted instead of the code.  Is that the case?

-Mark

Mark
NI App Software R&D
0 Kudos
Message 5 of 10
(5,418 Views)

I am using the same version of LabVIEW.  The programs that I am dealing with have been created in the last few months.

It is version: 8.1.5f5

0 Kudos
Message 6 of 10
(5,418 Views)

Interesting.... Why is it you cannot have both of these VIs open at the same time?

Mark
NI App Software R&D
0 Kudos
Message 7 of 10
(5,418 Views)

Thank you.

0 Kudos
Message 8 of 10
(5,418 Views)

I just had this same thing happen where copying and pasting code made a picture instead of copying the code.  I closed everything down and reopened and everything worked fine.  When i was closing it down though, I noticed I have two instances of the main labview project screen open (the one where you select create a project or open an existing project).

Theory is one program was being run through one instance of labview and the other in a different.  This would make labview think its a separate instance.

0 Kudos
Message 9 of 10
(5,418 Views)

How about trying drag and drop?

0 Kudos
Message 10 of 10
(5,418 Views)