<commit_before>// Copyright (c) 2017 The ivi developers. All rights reserved.
// Project site: https://github.com/gotmc/ivi
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE.txt file for the project.

package main

import (
	"log"

	"github.com/gotmc/ivi"
	"github.com/gotmc/ivi/fgen/agilent33220"
	_ "github.com/gotmc/usbtmc/driver/truveris"
	"github.com/gotmc/visa"
	_ "github.com/gotmc/visa/driver/usbtmc"
)

func main() {

	address := "usb0::2391::1031::MY44035849::INSTR"
	res, err := visa.NewResource(address)
	if err != nil {
		log.Fatalf("VISA resource %s: %s", address, err)
	}
	defer res.Close()
	fgen, err := agilent33220.New(res)
	if err != nil {
		log.Fatalf("IVI instrument error: %s", err)
	}
	defer fgen.Close()
	ch := fgen.Channels[0]
	ch.DisableOutput()
	ch.SetStandardWaveform(ivi.Triangle)
	ch.SetFrequency(1000)
	ch.SetAmplitude(0.25)
	ch.SetDCOffset(0.1)
	ch.EnableOutput()
	wave, err := ch.StandardWaveform()
	if err != nil {
		log.Fatalf("Error determining standard waveform: %s", err)
	}
	log.Printf("Waveform = %s", wave)
}<commit_msg>Show amplitude and freq in example<commit_after>// Copyright (c) 2017 The ivi developers. All rights reserved.
// Project site: https://github.com/gotmc/ivi
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE.txt file for the project.

package main

import (
	"log"

	"github.com/gotmc/ivi"
	"github.com/gotmc/ivi/fgen/agilent33220"
	_ "github.com/gotmc/usbtmc/driver/truveris"
	"github.com/gotmc/visa"
	_ "github.com/gotmc/visa/driver/usbtmc"
)

func main() {

	address := "usb0::2391::1031::MY44035849::INSTR"
	res, err := visa.NewResource(address)
	if err != nil {
		log.Fatalf("VISA resource %s: %s", address, err)
	}
	defer res.Close()
	fgen, err := agilent33220.New(res)
	if err != nil {
		log.Fatalf("IVI instrument error: %s", err)
	}
	defer fgen.Close()
	ch := fgen.Channels[0]
	ch.DisableOutput()
	ch.SetStandardWaveform(ivi.Triangle)
	ch.SetFrequency(1000)
	ch.SetAmplitude(0.25)
	ch.SetDCOffset(0.1)
	ch.EnableOutput()
	wave, err := ch.StandardWaveform()
	if err != nil {
		log.Printf("Error determining standard waveform: %s", err)
	} else {
		log.Printf("Waveform = %s", wave)
	}
	amp, err := ch.Amplitude()
	if err != nil {
		log.Printf("Error determining the amplitude: %s", err)
	} else {
		log.Printf("Amplitude = %.2f Vpp", amp)
	}
	freq, err := ch.Frequency()
	if err != nil {
		log.Printf("Error determining the frequency: %s", err)
	} else {
		log.Printf("Frequency = %.2f Hz", freq)
	}
}
{'fraction_non_alphanumeric': 0.15750487329434698, 'fraction_numerical': 0.03274853801169591, 'mean_word_length': 3.9825242718446603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5888084', 'n_tokens_mistral': 1065, 'n_tokens_neox': 996, 'n_words': 236}