4 New Ways to Use Array Notation: Simple Scaling

par Janet Albers | Mis à jour le : 05/29/2015 | Commentaires : 0

Les thèmes principaux du Blog


Recherche sur le Blog


Langages du blog

English
Français (French)


Abonnez-vous au Blog

Recevez un courriel lorsqu'un nouvel article est posté. Choisissez les sujets qui vous intéressent le plus.


Entrez votre adresse courriel :



Suggérer un article

Y a-t-il un sujet que vous souhaiteriez nous voir aborder ? Laissez-nous un message.

Leave this field empty

OS 28

The newest operating system released by Campbell Scientific for its data loggers is OS 28 for the CR800, CR1000, and CR3000. (The comparable operating system version for the CR6 datalogger is OS 01.) This powerful data logger OS has been enhanced so that you can use Array Notation in CRBasic multi-dimensional arrays in new ways. This article explores one of these methods—simple scaling. Three other methods (initializing multi-dimensional arrays, complex scaling, and copying or transposing) will be discussed in articles to follow.

Using the new operating system, you can now scale values in an array without the use of a For/Next loop.

For example:


Public TempC(2), TempF(2)
Public PTemp

BeginProg
	Scan (1,Sec,0,0)
		PanelTemp (PTemp,250)
		TCDiff (TempC(),2,mV2_5C,1,TypeT,PTemp,True ,0,250,1.0,0)
		'simple scaling
		TempF()=TempC()*1.8+32 'convert all TempC variables to TempF
	NextScan
EndProg

Note: This new syntax does not affect how repetitions within instructions write to, or read from, variable arrays. To see how to use array notation and repetitions within measurement instructions, watch the "CRBasic | Advanced Programming" video.

Tip: After updating your operating system, it’s a good idea to check your existing programs to ensure they continue to run as expected.

For more information about, and examples of, multi-dimensional arrays, we have several resources to help you. You can search for the section in your data logger manual titled "Array-Assigned Expression." The CRBasic Editor Help application in LoggerNet is also a good resource. For example, search for "multi-dimensional arrays':

Multi-dimensional arrays

Recommended for You: To learn more about OS 28, review the “Powerful New Operating System for CR800, CR1000, CR3000" newsletter article.

Simple scaling is one of the new ways to use Array Notation in CRBasic multi-dimensional arrays, without needing to use a For/Next loop. Three additional articles will discuss other new ways: initializing multi-dimensional arrays, complex scaling, and copying or transposing.

Do you have comments or questions? Feel free to share them.


Partagez cet article



A propos de l'auteur

janet albers Janet Albers est rédactrice technique senior. Elle vous fera part de ses conseils, simplifiera les concepts et vous guidera vers un projet réussi. Elle est à Campbell Scientific, Inc depuis plus longtemps que la CR1000, mais pas depuis aussi longtemps que la CR10X. Après les heures de travail, Janet aime le plein air avec ses garçons et ses chiens.

Voir tous les articles de cet auteur.


Commentaires

Please log in or register to comment.