Data export from chart
Submitted by vinayak on Wed, 09/15/2010 - 19:56
I need to export chart data as time vs variable(s) in text or csv files. I need to do this automatically every time a simulation is conducted for specified charts in the model. Please let me know if such functionality exists and how to use it. Suggest alternate ideas if such function is not available. My aim is to plot the chart in excel in real-time with this data.
Answers
-
Submitted by Anders89 on Thu, 09/16/2010 - 21:51.
Use the ramp block for time input on pin one and connect your data to pin 2. Select ',' as the Field Separator. Use '.csv' as your file suffix in the exported file name field. This will produce a .csv file that can be read directly by Excel.
VisSim can also send data in real-time using DDE. This This may let you do real-time plotting in Excel. Below is the Help from the DDE Send block:
DDE basics
By creating dynamic data exchange (DDE) links, you can share information in one file with several other files, and you need only maintain the original file; the other files are updated automatically. For example, if you store data in a Microsoft Excel spreadsheet, you can use that data in a VisSim block diagram. When you update the spreadsheet, VisSim automatically updates the data in the block diagram when you run a simulation.
You create DDE links by copying a selection from one application (referred to as the source or server) and pasting it into another one (referred to as the destination or client) using the Paste Link or Paste Special command. Before you can create a link, the source file must be saved to disk.
VisSim offers three blocks for creating DDE links:
- The DDEsend block, which links source information in a VisSim block diagram to another application, such as a Microsoft Excel or Visual Basic file.
- The DDEreceive block, which links source information in an application file to a VisSim block diagram.
- The DDE block, which establishes a two-way link: it acts as both the source (sender) and destination (receiver). For example, a DDE block can send data to a Visual Basic program to work on, and then receive the updated data back from Visual Basic.
You can create DDE links only between VisSim and other Windows applications that support DDE linking. Some applications do support DDE links, but do not support creating the links by copying and pasting selections. When this is the case, you can still create a link by entering the link address directly to both the source and destination files.
Creating a VisSim-to-app link with DDEsend
To create a DDE link from a VisSim block to another application:
- In VisSim, wire a DDEsend block to the output of the block that contains the information you want linked to another application.
- Choose Edit > Block Properties and click the mouse over the DDEsend block.
- Click on the Copy Link button.
- Click on the OK button, or press enter.
- Switch to the destination application and open the file in which you want to create a link.
- Position the insertion point where you want to insert the information.
- Choose Edit > Paste Link.
Note: Some applications have a Paste Special command instead of a Paste Link command. Refer to the application's documentation for information on linking.
The DDE Send Link Configure dialog box appears. In the Send Item box, enter a name. The default name is simDataIn.
Note: When the block diagram contains multiple links to other applications (that is, the diagram contains more than one DDEsend block), the name you enter in the Send Item box must be unique to that block diagram. If it’s not unique, VisSim will not pass the correct information to the application.
0 -
Submitted by vinayak on Fri, 09/24/2010 - 19:09.
The DDE send block seems to send the value (one value) to one cell. In reality the simulation generates hundreds of values. How do I make the DDE send to write in a sequence? Example, A1,A2,...An as column data in excel?
0