Problemas Puerto Serie
Hola estoy usando Labview 2010, lo tengo instalado en dos ordenadores, un portatil y un sobremesa, los dos funcionan con windows XP, ahora estoy trabajando con un programa que unicamente manda comandos Rs232 por el puerto serie, y el mismo programa en los dos ordenadores en el sobremesa me reconoce los puertos en el panel frontal, mientras que en el portatil cuando pincho sobre el icono de visa resorce para elegir el puerto me aparece todo el rato "refresh" y no me reconoce ni el conversor USB-Rs232 ni ningun otro puerto. No se si sera problema de drivers de mi portatil, porque la conversor USB-Rs232 me lo reconoce en administador de dispositivos me lo reconoce bien.He probado a bajar un pack de 171 Mb de drivers que encontre por esta pagina para el labview2010 y nada. Alguien sabe como puedo solucionar esto?.
(adjunto el programa que he hecho)
Gracias.
Attachments:
Funciona_9_bateria.vi 54 KB
English translation:
Hi I'm using Labview 2010, I have it installed on two computers, a laptop and a desktop, both running Windows XP, now I'm working with a program that sends commands only Rs232 for the serial port, and the same program on both computers I recognized the desktop ports on the front panel, while in the laptop when I click on the icon resource visa to choose the port I get all the time "refresh" and I do not recognize or USB-RS232 converter or any other port.
No problem if drivers will be my laptop because the USB-RS232 converter recognizes it. I tried to download a pack of 171 MB of drivers I found on this page to the labview2010 and nothing . Anyone know how I can fix this?.
==========================================================================
Do you have a terminal emulator application (ie: TerraTerm, HyperTerminal) installed? Are you able to configure the serial port of the Laptop using the terminal emulator application? If so, then you should also be able to configure the serial port in LabVIEW the same way.
I had a quick look at your code which seems highly overcomplicated. You should start building from the basics. You should look for existing examples for the serial port. I will look for an example that I posted a few months ago.
¿Tienes un emulador de terminal (por ejemplo: TerraTerm, HyperTerminal) instalado? Si eres capaz de configurar el puerto serie del ordenador portátil utilizando el emulador de terminal? Si es así, entonces también debe ser capaz de configurar el puerto serie en LabVIEW de la misma manera.
Tenía una mirada rápida a su código que parece muy complicadas. Usted debe empezar a construir desde lo más básico. Usted debe buscar ejemplos existentes para el puerto serie. Voy a buscar un ejemplo que me envió hace unos meses.
Similar Messages
-
Comunicacion con un puerto serie virtual usando SPI
Hola a todos. Podeis ayudarme con esto??
Quiero comunicarme con un puerto serie virtual usando SPI. Me he bajado un pack de SPI de NI, pero no estoy muy seguro de que funcione.Teneis algún ejemplo para guiarme o algún tutorial??
Gracias.Hola Serrano_10,
Los códigos ASCII son la representación numérica de los caracteres que tradicionalmente un PC es capaz de entender. Habitualmente cuando te comunicas por puerto serie, VISA realiza la conversión a tipo string, por lo que no tienes por qué preocuparte de esto. Si estás recibiendo caracteres extraños probablemente se deba a que el protocolo de comunicación con tu dispositivo utilice caracteres como ACK, SOH o STX que no tienen una representación en forma de carácter. El siguiente link contiene la tabla ASCII. Para pasar de caracteres ASCII a decimal y viceversa, te adjunto un pequeño ejemplo.
Por último, ¿podrías adjuntar un pantallazo del error que estás registrando?
Un saludo,
Adjuntos:
Untitled 2.vi 8 KB -
Saludos,
Deseo elaborar una interface en labview que me muestre los valores de dos sensores analógicos conectados cada uno a módulos Xbee independientes. Encontre una publicación referente a una libreria en Labview para trabajar con modulos Xbee serie 2 en modo API, de esta publicación estracte la parte de lectura de tramas API de los Xbee que esta basada en una estructura productor consumidor. Despues de probar y consultar varias fuentes logre crear una interface que funciona de forma parcial, el problema radica en que la interface solo me muestra la información proveniente de un módulo Xbee y la informacion del segundo módulo Xbee se pierde, si apago el módulo del cual estaba recibiendo información enpiezo a recibir la información del módulo que queda encendido.
Adjunto el proyecto como lo he depuerado hasta la fecha para que me colaboren con una revisión que me ayude a resolver mis inconvenientes.
nota: para ejecutar la interface se debe abrir el proyecto y abrir el VI principal prueba2403
Attachments:
Labview.zip 59 KBRespecto a tu afirmación, no estás equivocado, utilizo una interfaz XBee-USB para la recepción de información en la computadora. En esta tarjeta está montado un módulo XBee configurado como coordinador zigbee en modo API, este coordinador recibe información de dos módulos configurados como dispositivos finales que tienen conectados cada uno un sensor analógico y leds que hacen la vez de encendido u apagado de un actuadores.
¿Es posible que esté recibiendo datos de ambos sensores pensando que es solo uno?
Este es mi dilema!, LabView recibe información de ambos módulos e interpreta los datos de los sensores conectados a ellos cuando esta encendido cualquiera de los módulos, si enciendo los dos al tiempo muestra información de ambos al inicio pero luego solo muestra la información proveniente de un módulo.
¿Cómo identifico de dónde viene el dato del sensor?
Cada módulo XBee trae una dirección de 64bits que viene de fábrica similar a la MAC de una tarjeta de red para PC, en mi caso utilizo una parte de esta dirección para identificar de donde proviene la información de cada sensor, el VI que hace esto se llama selección módulos, este VI usa una estructura case para verificar la dirección de procedencia de la trama, y dependiendo de la dirección hace una conversión de Hex a decimal y calcula valores de temperatura o nivel.
El inconveniente que se presenta no radica en identificar de donde proviene a información, ya que el programa si lo hace. A mi parecer el problema se presenta en el VI lector de tramas, este VI lee la información del puerto serial y la almacena en un queue que luego se pasa como referencia a un proceso paralelo donde se verifica si la información recibida corresponde a una trama API y si es así, este proceso genera un cluster que contiene la trama y la almacena en un queue. Es aquí donde pienso que se presenta la perdida de información, no se si por sobre flujo (el muestreo de los sensores se realiza cada 500ms) o talvez por una mala configuración del puerto serial.
Para que tengan más claridad al respecto, adjunto la publicación en PDF de donde tome esta forma de leer las tramas.
Attachments:
xbee labview.pdf 360 KB -
Windows 8 problems 2575 series all in one
Recently I bought a new laptop which runs Windows 8(64-bit) and when I tried to install the software required to run my printer (2575 series all in one) I couldn't because the software wasn't compatible with windows 8.
Is there any way for me to install a driver, an emulator or some kind of software that would allow me to accses my printer?
Edit: sorry, accidentaly double posted somehow.The HP 2575 is compatible with Windows 8
Go to this site, Drivers and Software, Select your OS and download the Full Feature Software and Drivers.
http://support.hp.com/us-en/product/HP-Photosmart-2570-All-in-One-Printer-series/441247/model/441248...
Please mark my post as SOLVED if it has resolved your problem. It helps others with similar situations. -
Additional record time problem with series
I cannot record a particular show appearing on a local PBS station beyond the time the show is on. The show is EastEnders & it comes on every Sunday night. There are 2 different episodes, one starts at 11pm & ends at 11:30, the 2nd show starts at 11:30 PM & ends at midnight. There are no episode titles, It appears simply as EastEnders for both time slots in the program guide
When I set up the series recording on my FiOS DVR, I set it to record a specified length of time after the show ends, so I don't miss any of it in case the show runs long. The problem is that although I have set it up correctly, the DVR will not record for any length of time after the 2nd show ends. I have tried setting it to record 15, 30, 60 & 90 minutes after the show ends & it always stops recording just at the point the 2nd show ends. I know it is not the actual DVR at fault as I tried this on both of my DVRs & the same thing happened. Also, this is the only show that I have a problem with. Other shows that I have set up to record longer, do so without a problem.
I have spoken to FiOS tech support several times about this issue & can't resolve it. They said they get calls from customers with issues like mine from time to time, but don't know what the problem is.
Could this have something to do with the way the PBS station communicates it's program guide to Verizon? If so, what exactly is the issue? Is there a fix?
Solved!
Go to Solution.Try making a manual recording. You can specify the start time, end time, and recurrence on a specified day of the week. That should eliminate any issues the guide may be causing. You can't attach the show's name so it will show up in your list of recordings as a manual recording.
-
bonjour,
j'ai un probleme de reception de données :
Mon programme doit gerer un moteur par palier de vitesse et lire la vitesse (tr/mn)toute les secondes
Le moteur est de type courant continu et est controlé par une interface laison serie 19200 bd.
Les commandes d'envoi et de reception sont des chaines de caracteres (2 à 4)
J'ai fait un premier VI qui n'utilise que des commandes d'écriture (envoi de la vitesse par palier)
j'ai fait un 2eme VI qui n'utilise que des commandes de reception (lecture vitesse codeur,boutons ON/OFF,voyants MotON,Défaut.....)
Les 2 VI lancés ensemble fonctionnent bien (je lis bien la vitesse de mon palier...)
J'ai fait un VI qui integre les 2 et la , c'est la cata !!
Les données recues ne correspondent à rien car je récupere des caracteres de fin de chaines d'envoi (;;;; car une commande d'écriture doit se terminer par un CR ou un ;.(malgrés un masque et un echo off)
De plus , le VISA READ dont le nombre d'octets de reception était fixé à 10 sur le 2eme VI et qui marchait ,plante dans ce programme si ce nombre est supérieur à 6 ?!!! (je dois saturer le buffer de ;;; ! (une tempo de 100ms entre WRITE et READ ne resout pas le pb)
Merci pour une solution salutaireBonjour,
Nous avons besoin d'informations complémentaires pour répondre à votre demande. Pourriez-vous svp nous envoyer :
- votre VI
- la version de LabVIEW que vous utilisez
- la version du driver NI-Visa que vous utilisez
Avez-vous par ailleurs localisé le problème notamment via les outils de débugage sous LabVIEW tels que la petite lampe, les sondes ou le mode d'exécution pas à pas ?
Bien cordialement,
Yannick D.
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> Du 30 juin au 25 août, embarquez pour 2 mois de vidéo-t'chat ! Prenez place pour un voyage au coe... -
I have a HP Pavilion G7 series laptop.
Recently there was thea spoiled over the keyboard.
Laptop was working only jammed with a few buttons.
I decided to open the backside first and later on the top in order to remove the keyboard.
Removed the keyboard and cleaned it.
After replacing all the tops and screws there's no power on the laptop.
The Led light is not showing anything when I connect the adapter.
Even tried it without the battery, pushed the power button for 30 sec and tried to start up with the adapter connected.
Still no joy.
Reopened the computer to see if there was a cable problem nearby the ac adapter. detected no visual errors.
Can you advise me on possible other options which I can try?Sounds like it died a long death. You have done exactly what you should do to troubleshhot and the only conclusion is that the tea finally did its dirty work and the motherboard died.
-
[NX 6600GT] Strange Driver problems, 66 series vs 70
The 66 series is most stable at my machine atm, with them I can play Sacred, Delta Force Extreme and few other games without a hitch but newer games like Swat 4 and Psychonauts are full of glitches and graphical errors, if I switch to 70 series (I have tested 71.22,71.25,71.89, 72.12,76.45) I don't have any graphical errors in Swat 4 or Psychonauts but they will lockup after 10-15 minutes of playing and then I have graphical errors in Sacred and DF Extreme.
So, Any ideas what is going on?
Thanks in advancepette,
I found the link to your Power Supply. It looks like resonable numbers for the comp you are running:
NX-4090 Real Silent Power Supply 400Watt ATX 2.0
Is that mobo as ASUS or is it an Abit? (I think it is this one):
SR7-8X
I would start by removing all the Drivers, running Driver Cleaner, then install the latest SiS Drivers for the Mobo followed by the latest nVidia ForceWare Drivers
Take Care,
Richard
P.S. It would not hurt loading SP2 either. -
Dear all
I am facing a problem with a 3560v2
the sys and rps leds gives amber allert , also when booting the swith in normal mode it shows attached and then hangs.
also find attached dir flash from the room mode.
Kindly advise and help.
Regards
Ahmad Zin
Ain Shams
Network EngineerYou are running 15.0(1)SE1????
Try a different IOS. The version you are running is very, very buggy.
Try either 15.0(2)SE4 or 12.2(55)SE8. -
Configuración del puerto serie (serial port configuration)
Hello I want to configure my serial port using Labview to achive this settings
IRP_MJ_CREATE Serial0 SUCCESS Options: Open
IOCTL_SERIAL_SET_QUEUE_SIZE Serial0 SUCCESS InSize: 2048 OutSize: 500
IOCTL_SERIAL_SET_TIMEOUTS Serial0 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0
IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 19200
IOCTL_SERIAL_SET_RTS Serial0 SUCCESS
IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:0 ERR:0 BRK:0 EVT:d XON:11 XOFF:13
IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:1 Replace:80000040 XonLimit:2048 XoffLimit:512
IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS
IOCTL_SERIAL_PURGE Serial0 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
IOCTL_SERIAL_SET_WAIT_MASK Serial0 SUCCESS Mask: RXFLAG ERR
IOCTL_SERIAL_WAIT_ON_MASK Serial0 SUCCESS
IOCTL_SERIAL_SET_WAIT_MASK Serial0 SUCCESS Mask:
Thank you in advance,
RegardsHello I want to configure my serial port using Labview to achive this settings
IRP_MJ_CREATE Serial0 SUCCESS Options: Open
IOCTL_SERIAL_SET_QUEUE_SIZE Serial0 SUCCESS InSize: 2048 OutSize: 500
IOCTL_SERIAL_SET_TIMEOUTS Serial0 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0
IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 19200
IOCTL_SERIAL_SET_RTS Serial0 SUCCESS
IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:0 ERR:0 BRK:0 EVT:d XON:11 XOFF:13
IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:1 Replace:80000040 XonLimit:2048 XoffLimit:512
IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS
IOCTL_SERIAL_PURGE Serial0 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
IOCTL_SERIAL_SET_WAIT_MASK Serial0 SUCCESS Mask: RXFLAG ERR
IOCTL_SERIAL_WAIT_ON_MASK Serial0 SUCCESS
IOCTL_SERIAL_SET_WAIT_MASK Serial0 SUCCESS Mask:
Thank you in advance,
Regards -
Saludos a todos los miembros, estoy realizando una comunicación por puerto serie entre dos computadoras, deseo hacer un chat entre las dos, lo programe para que al preesionar la tecla enter(por estructura de eventos) se envie el mensaje, pero el problema es que el receptor solo recepta si presiona alguna tecla.
Asumo que el lapso queda encerrado en el la estrcutura de evento y por eso espera a presionar una tecla y luego pueda leer el mensaje.
Alguien que me ayude a solucionar el problema.? adjunto el programa y fotos del mismoEstás intentando leer 1024 bytes, que pueden ser demasiado para el comando IDN. El error dice que no han llegado los caracteres en el tiempo previsto.
¿Cuántos bytes esperas de tu dispositivo? Si no lo sabes, intenta poner un valor bajo en el campo bytes to read y mira lo que pasa.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Hola todos, tego un programa realizado en labview que envia caracteres por el puerto serie. Mi problema es que no me detecta los puertos COM virtuales que tengo. El programa anda bien en otras computadoras pero nosé porqué ami no me deceta ningun puerto. Podria ser algun problema de que me faltan instalados algun tipo de drivers de labview o algo por el estilo como alguna configuracion o algo? Adjunto el programa
Attachments:
Nueva logica.vi 62 KBduplicate post
You are already being helped in your other post. Please be patient. This is a forum of volunteers. -
Estoy realizando una aplicacion para manipular 6 reles por medio de las salidas digitales del puerto 0 de la targeta nidaq6008 pero solo me funciona una sola salida y estoy trabajando con nidaqmxbase
Hola Julianchoqn,
Gracias por utilizar el foro de NI como medio para resolver cualquier duda. Junto con la comunidad intentaremos resolver el problema de la mejor manera...
Puede que sea por la manera de escribir en cada una de las líneas, si se está haciendo de manera individual o en conjunto a todo el puerto. Debemos de tener en cuenta que el puerto completo conforma todas las líneas que lo conforman, podemos manejarlo como un entero o de manera individual línea por línea. Si pudieras compartirnos un poco de cómo estás haciendo la escritura en los puertos, sería de gran ayuda para darte algún tip completamente válido.
Te comparto un par de ejemplos donde que nos servirán para el entendimiento y el desarrollo de la programación usando DAQmx.
http://www.ni.com/white-paper/2835/es#toc8
https://decibel.ni.com/content/docs/DOC-23201
https://decibel.ni.com/content/docs/DOC-8010
También debemos de prestar especial atención a la corriente que nos puede ofrecer la DAQ en cada salida, ya que podemos dañar la tarjeta por una mala conexión. Para esto te comparto la hoja de datos de la tarjeta para que puedas observar estas especificaciones.
http://sine.ni.com/psp/app/doc/p/id/psp-117/lang/es
Una recomendación sería que utilizaras algún método de encapsulación en la tarjeta, el uso de optoacopladores puede ser una solución.
Saludos y suerte con tu desarrollo.
Omar,
Omar I.
Applications Engineer
National Instruments -
Problemas no recebimento de XML via E-mail caracteres especiais Valid ***.
Boa tarde
Mestres
Este problema descrito abaixo só acontece qnd recebo XML com caracteres especiais entre as tags Enter, Tabs, Espaço....
que representam 30% dos XML recebidos via E-MAIL
Estou tendo problemas quando tenho a Assinatura Digital verificada pelo Serviço disponibilizado pelo Visual Administrador(Verify)
Hoje recebo um XML por e-mail...resgato a string do XML no Kpro (GRC) e envio para esse serviço de Validação de Assinatura o mesmo Invalida a Assinatura
Quando o mesmo é submetido ao validador do governo Programa Visualizado NF-e 3.5 e ao serviço SEFAZ RS http://www.sefaz.rs.gov.br/ASP/AAE_ROOT/NFE/SAT-WEB-NFE-VAL_1.asp a assinatura é dada como Valida
Bom ...o senhores devem estar se perguntando será que esse arquivo não esta sendo corrompido na transferencia do mesmo para o Kpro ou no envio da msg para o serviço de validação de assinatura..., por esse motivo executei alguns ciclos de teste..:
1 - Baixei o arquivo original para minha máquina e executei a validação usando o programa do governo
Visualizador NFe 3.5 / serviço SEFAZ RS - Assinatura Válida
2 - Executei a Interface através do PI enviando uma MSG contendo a string do xml NFe resgatada no Kpro... para esse
Serviço disponibilizado pelo Visual Administrador(SAP) as java - Assinatura Invalida
3 - Baixei o Payload da MSG da interface de Validação da ***. Digital pela transação SXI_MONITOR Ajustei o xml editando em um bloco de notas (trocando os caracteres <> para maio e menor)
Visualizador NFe 3.5 / serviço SEFAZ RS - Assinatura Válida
4 - Criei um programa abap ler a string do XML no Kpro (GRC) e baixar ..local
Visualizador NFe 3.5 / serviço SEFAZ RS - Assinatura Válida
5 - Executei a Interface através do PI enviando uma MSG contendo a string do xml ...local ..teste executado através da transação SPROXY
- Assinatura Invalida
em qual serviço estará o Problema?
Alguém já enfrentou esse problema ou esta enfrentando?...pois esse tipo de problema parece ser muito comum pois nem toda empresa tem SAP ....e o problema é que o SEFAZ aceita e valida esses XMLs...!
pois estou pensando em seguir parte desta sugestão
agradeço desde já ....!
Edited by: Ronaldo de Moraes on Oct 21, 2009 3:05 AMRonaldo,
claramente há algum problema com a codificacao do arquivo.
Abra o xml no Notepad e verifique que na tag Signature, há varias quebras de linha, incluindo caracteres nao reconhecidos (representados como um retangulo).
Ainda, como vc está testando o servico verify?
Vc fez uma interface XI? Porque não há interface PI standard p/ o serviço verify.
Ainda, como vc chamou essa interface? Pela tela de teste do Runtime Workbench?
O próprio ctrl+c que vc dá no conteúdo pode estar corrompendo os dados.
O fato de vc estar utilizando um browser para o teste poderia corroborar isso.
Faça o seguinte teste:
1. Através do XMLSpy, criar uma SOAP Request p/ a interface verify (menu SOAP -> Create New SOAP Request)
2. a tag Send SOAP Request). Aqui deu válida;
4.2. abra o .xml que vc quer testar no notepad, copie a tag Send SOAP Request). Aqui deu inválida.
Ou seja, dependendo da maneira que vc trata o conteudo (aplicacao onde vc abre o .xml, ctrl+c etc) vai haver uma modificacao da codificacao.
Nao vejo muita maneira de garantir que funcione sempre a nao ser removendo esses caracteres, conforme definido pela propria SEFAZ.
Att,
Henrique. -
Programitically creating column series to flex chart not showing the chart
I want to create n number of series dynamically when i run my
application.
where n can be any value it depends on the data which i
retrieve from database. below i pasted the example
( in this example i have taken n = 4 i.e., CountMax=4 if i
change the CountMax=6 then it should generate 6series dynamically
after calculating the values. ). just copy the below code and paste
it in Flex builder and run the application.
in this example i am facing problem, chart series are not
showing. i dont know the reason why its not showing, if anyone got
the solutions for the problem please let me know. my actual
requirement is to retrieve data from Salesforce account and want to
populate the arraylist then display the chart.
<?xml version="1.0"?>
<!-- Example showing using mx:LineSeries vs using AS to
create chart series programmatically -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="drawChart()" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.charts.series.ColumnSeries;
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;
[Bindable]
public var categoryArray:ArrayCollection = new
ArrayCollection();
[Bindable]
public var sArray:ArrayCollection = new ArrayCollection();
public function drawChart():void
var histMax:int = 25;
var histMin:int = 5;
var countMax:int = 6;
var tmpArr:Array = new Array();
categoryArray.removeAll();
for(var n:int = 0; n < 10; n++)
tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
histMin));
categoryArray.addItem({data:tmpArr[n]});
// Add a series to the chart with the x-values and y-values
// from the arrays and set the series type to a column chart
for(var chartSeries:int = 0; chartSeries < countMax;
chartSeries++)
var tmpseries:Array = new Array(10);
for(var i:int = 1; i < 10; i++)
tmpseries = 3 * Math.random();
var cs:ColumnSeries = new ColumnSeries();
columnchart1.series.join( = [cs];
sArray.addItem({data:tmpseries});
//columnchart1.dataProvider = sArray;
cs = new ColumnSeries();
cs.dataProvider= sArray;
cs.displayName = 'Series';
cs.yField = 'data';
columnchart1.series[chartSeries] = cs;
]]>
</mx:Script>
<mx:Panel title="Dynamic Series Adding Sample"
width="195%" height="90%" layout="absolute">
<mx:ColumnChart id="columnchart1" height="338"
width="396" showDataTips="true" type="stacked" x="10" y="0">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{categoryArray}"
categoryField="data"/>
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LinearAxis baseAtZero="true" maximum="3"
autoAdjust="true"/>
</mx:verticalAxis>
</mx:ColumnChart>
</mx:Panel>
</mx:Application><?xml version="1.0"?>
<!-- Example showing using mx:ColumnSeries vs using AS to
create chart series programmatically -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="drawChart()" layout="absolute">
<mx:Script>
<![CDATA[
import mx.graphics.SolidColor;
import mx.charts.HitData;
import mx.controls.Alert;
import mx.charts.series.ColumnSeries;
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;
[Bindable]
public var categoryArray:ArrayCollection = new
ArrayCollection();
public function drawChart():void
var histMax:int = 25;
var histMin:int = 5;
var countMax:int = 3;
var tmpArr:Array = new Array();
categoryArray.removeAll();
for(var n:int = 0; n < 10; n++)
tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
histMin));
categoryArray.addItem({data:tmpArr[n]});
var cs:ColumnSeries = new ColumnSeries();
columnchart1.series = [cs];
// Add a series to the chart with the x-values and y-values
// from the arrays and set the series type to a column chart
for(var chartSeries:int = 0; chartSeries < countMax;
chartSeries++)
var tmpseries:Array = new Array(10);
for(var i:int = 0; i < 10; i++)
tmpseries
= 1 * Math.random();
if(tmpseries > 0.5)
tmpseries
= 1;
else
tmpseries = 0;
var testArrCol:ArrayCollection = new ArrayCollection();
for(var j:int =0; j < 10; j++)
var m:Number = tmpArr[j];
var m1:Number = tmpseries[j];
testArrCol.addItem({mData:m.toString(),nData:m1.toString()});
cs = new ColumnSeries();
cs.dataProvider = testArrCol;
cs.displayName = 'Series' + chartSeries;
cs.xField = 'mData';
cs.yField = 'nData';
columnchart1.series[chartSeries] = cs;
public function myTipFunction(hitData:HitData):String
return(ColumnSeries(hitData.element).displayName +" - "+
hitData.item.mData + "\n" + "Value : "+ hitData.item.nData);
]]>
</mx:Script>
<mx:Panel title="Dynamic Series Adding Sample" width="98%"
height="90%" layout="absolute">
<mx:ColumnChart id="columnchart1" height="338"
width="396" showDataTips="true" type="stacked" x="10" y="0"
dataTipFunction="{myTipFunction}">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{categoryArray}"
categoryField="data"/>
</mx:horizontalAxis>
<mx:verticalAxisRenderer>
<mx:AxisRenderer visible="false"/>
</mx:verticalAxisRenderer>
</mx:ColumnChart>
</mx:Panel>
</mx:Application>
Maybe you are looking for
-
How can i load a VI from LABVIEW ver 6.0.1b3 to LABVIEW ver 6.1
How can i load a VI from LABVIEW ver 6.0.1b3 to LABVIEW ver 6.1......I want to load a vi but i'm getting this error: LabVIEW load error code 9:VI version (6.1) is newer than LabVIEW version (6.0.1b3) My LabVIEW ver is 6.1 Please help ......it's impor
-
InDesign crashes when syncing book with Hyperlinks in master
Hi, I seem to have an issue with InDesign crashing when trying to sync a Book (INDB file) with page links (Hyperlinks) in the Master. Ref. Hyperlink panel > Edit Hyperlink > Link To: Page I've narrowed the crashing issue down to InDesign only crashin
-
XML Content and Linked containers
Hi, I just downloaded the trial of CS5 and I was wondering how to do the following. I have 5 XML files that load into my site. Each one is called by a button click. On the initial stage I have 2 containers which are linked for overflow text. So he
-
I set up a new PIN to lock my screen for security. Now I can't unlock it. Any idea how to undo this so I can use my phone again?
-
How can I make a link in a AccordionTab?
Hi, This is my website: www.student.tue.nl/V/b.a.t.moor As you can see the basis for my website is a Spry Accordion. The words with a large font-size are the first navigationlevel. The smaller words in the Tabs are the secondaire navigationlevel. Now